在hyper-v安装centos7后与windows10共享文件夹

admin6年前IT技术2207

 挂载Windows共享文件夹的方法:

1.在windows10宿主机下新建一个共享文件夹,比如叫share_win,并将其设为共享文件夹。

2.在CentOS下,执行命令:

mount -t cifs -o username=admin,password=123456,rw,uid=1000,gid=1000 //192.168.3.2/wwwroot /mnt/wwwroot
  • xxx是windows10的信息,一个是用户名而另一个是其对应的密码。

  • 192.168.*.*是windows的ip,share_win是刚建的windows10的共享文件夹。

  • /mnt/share_centos是挂载到centos7系统的位置,也可以改成其它地方。

3.开机启动自动挂载文件夹的方法(前提是宿主机能有固定IP,需要先在路由器中分配好):

在/etc/rc.local文件中添加下列代码,

mount -t cifs -o username=admin,password=123456,rw,uid=1000,gid=1000 //192.168.3.2/wwwroot /mnt/wwwroot

在CentOS 7中,rc.local的权限被降低了,所以还要多执行一句

chmod +x /etc/rc.d/rc.local

赋予rc.local执行的权限

相关文章

php – DOMXpath – 获取一个元素的href属性和文本值[转]

原文https://stackoverflow.com/questions/6820429/domxpath-get-href-attribute-and-text-value-of-an-a-ele...

pr的设置视频高度宽度的方法

1.在序列里设置具体的比例2.在"效果"-"视频效果"-"变换"---"裁剪"拖到视频里  然后在"...

系统激活

win10激活 slmgr /skms kms.03k.orgslmgr.vbs -ato        计算机\HKEY_LOCAL_MACHINE...

excel引用另外一个sheet里的数据

公式如下=Sheet3!H6...

未命名

<?phpnamespace Article;class Comment { }namespace MessageBoard;class Comment { }//调用当前空间(MessageB...

windows下安装、卸载mysql服务

windows下安装、卸载mysql服务2012年03月09日 16:30:20阅读数:52062 将下载下来的mysql解压到指定目录下(如:d:\mysql)安装服务 在命令行输入d:\...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。