现在的位置: 首页 > 综合 > 正文

虚拟机ubuntu10.10与xp共享文件夹(samba服务模式)

2012年12月12日 ⁄ 综合 ⁄ 共 1345字 ⁄ 字号 评论关闭

 

环境:主机windows xp系统,虚拟机vmware 7.1.3,虚拟机中安装了ubuntu10.10。

 

需求:希望在xp中用source insight编辑工程,然后在ubuntu下编译,省去来回拷贝代码。因此需要在虚拟机和xp系统中共享工程。

 

问题:用Vmware tools能在xp和ubuntu中共享文件,编译不能通过,提示“creating symbolic link "include/asm" "operation not supported"”。而是用samba可实现上述功能,具体操作如下:

 

1、首先安装samba软件包:

root@ubuntu:~#apt-get install samba

root@ubuntu:~#apt-get install samba4

(注:最初只安装samba,发现在进行samba服务启动或停止时,命令不识别,因此再安装samba4软件包。)

samba命令:

启动服务:root@ubuntu:~#/etc/init.d/samba4 start

停止服务:root@ubuntu:~#/etc/init.d/samba4 stop

restart:root@ubuntu:~#/etc/init.d/samba4 restart

 

2、创建共享文件夹

a)在home文件夹下创建share文件夹

b)编辑smb.conf:

root@ubuntun:~#gedit /etc/samba/smb.conf

将smb.conf中的security=user更改为security=share,并在最后增加:

[share]
comment=this is Linux share directory
path=/home/share
public=yes
writable=yes
保存smb.conf文件后退出

c)重启samba服务:

root@ubuntu:~#/etc/init.d/samba4 restart

 

3、xp访问共享文件夹

a)查看虚拟机的ip地址:

root@ubuntu:~#ifconfig

得到虚拟机中ubuntu的ip地址为192.168.102.129(此时用xp中的命令行,可以ping通ubuntu)

b)在xp中点击运行输入//192.168.102.129

看到share文件夹,点击进入,share文件夹即为共享文件夹,把工程放入share文件夹中,在xp下就可以访问

 

参考资料:

1、遇到ln: creating symbolic link XXXXXX : Operation not supported时的解决办法:

http://hi.baidu.com/serial_story/blog/item/e020421e098d71fc1ad576e5.html

2、Ubuntu10.10下Samba服务器的搭建

http://hi.baidu.com/chenyangxin/blog/item/9c388050681bfd738535248e.html

3、启动虚拟机后在网上邻居会看到两个虚拟机的链接

http://www.zhiwenweb.cn/article.asp?id=1211

4、ubuntu中设置ip

http://panxq0809.javaeye.com/blog/721644

抱歉!评论已关闭.