Ubuntuä¸åˆ©ç”¨samba将本地文件给vmwareä¸çš„windows使用
VMwareä¸è·‘çš„windows现在都æ£å¸¸ï¼Œåªæ˜¯è®¿é—®æ–‡ä»¶æ¯”è¾ƒéº»çƒ¦ï¼Œå› ä¸ºç©ºé—´ä¸å¤§ï¼Œå¦‚æžœæ¯æ¬¡éƒ½è¦é€šè¿‡æ–‡ä»¶å¤åˆ¶åˆ°vmä¸çš„硬盘的è¯ç©ºé—´è‚¯å®šæ˜¯ä¸å¤Ÿçš„。解决方案就是用samba把文件æä¾›ç»™vmware使用
çœ‹äº†è¿™ç¯‡æ–‡ç« ï¼Œ
The full title of this howto should be:
“How to setup samba peer to peer with Windows XP which is running as a VMWare server guest on a Ubuntu Dapper host to share files easily”
Using VMWare server to run Windows programs which are not available on Linux will enable you to never have to dual boot again to run your essential Windows applications.
To install VMWare server, follow the directions at:
http://www.ubuntuforums.org/showthre…ghlight=vmware
Once VMWare is successfully installed and you have Windows XP installed as a guest, you should read Stormbringer’s howto at:
http://www.ubuntuforums.org/showthre…ghlight=vmware
This howto is very largely based on Stormbringer’s work, but because I had so much difficulty in getting samba to connect to my Windows XP guest I thought some people might appreciate knowing what steps I finally used.
If you don’t use Gnome, you’ll have to make a few adjustments.
Ok, here we go…
1)Use Synaptic Package Manager to install samba, samba-common, smbclient and smbfs.
2)Use System -> Administration -> Shared folders to make a shared folder. I suggest you use /home/YOUR_NAME/samba. In Properties:
a) Share with: SMB
b) Name: MyFiles
c) Tick Allow browsing folder
d) In Windows sharing settings, “Domain/Workgroup†is MsHome (or whatever your guest XP machine is) and select “This computer is a WINS serverâ€.
e) Press OK, OK
3)Set permissions on your shared file:
sudo chmod 0777 /home/YOUR_NAME/samba
4)Stop samba:
sudo /etc/init.d/samba stop
5)Backup the original smb.conf file:
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.backup
6)Make a new smb.conf file:
sudo touch /etc/samba/smb.conf
7)Open smb.conf for editing:
sudo gedit /etc/samba/smb.conf
Paste the following into your smb.conf file (mostly copied from Stormbringer)…
(I’ve put *** (no)against the entries you may need to change immediately. Please remove the ***(nos) when you’ve finished editing.)
[global] ;General server settings netbios name = Ubuntu***(1) workgroup = Mshome***(2) announce version = 5.0 socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192 passdb backend = tdbsam security = user null passwords = true username map = /etc/samba/smbusers name resolve order = hosts wins bcast wins support = yes printing = CUPS printcap name = CUPS syslog = 1 syslog only = yes ; NOTE: If you need access to the user home directories uncomment the ; lines below and adjust the settings to your hearts content. ;[homes] ;valid users = %S ;create mode = 0600 ;directory mode = 0755 ;browseable = no ;read only = no ;veto files = /*.{*}/.*/mail/bin/ ; NOTE: Only needed if you run samba as a primary domain controller. ; Not needed as this config doesn't cover that matter. ;[netlogon] ;path = /var/lib/samba/netlogon ;admin users = Administrator ;valid users = %U ;read only = no ; NOTE: Again - only needed if you're running a primary domain controller. ;[Profiles] ;path = /var/lib/samba/profiles ;valid users = %U ;create mode = 0600 ;directory mode = 0700 ;writeable = yes ;browseable = no ; NOTE: Inside this place you may build a printer driver repository for Windows [print$] path = /var/lib/samba/printers browseable = yes guest ok = yes read only = yes write list = root create mask = 0664 directory mask = 0775 [printers] path = /tmp printable = yes guest ok = yes browseable = no ; Uncomment if you need to share your CD-/DVD-ROM Drive ;[DVD-ROM Drive] ;path = /media/cdrom ;browseable = yes ;read only = yes ;guest ok = yes [MyFiles] path = /home/YOURNAME/samba***(3) browseable = yes read only = no guest ok = no create mask = 0644 directory mask = 0755 force user = paul***(4) force group = paul***(5) available = yes public = yes writable = yes
9)Personalise your new smb.conf file by editing the ***(nos). You can do any other editing you want to do later when everything is up and running.
***(1) Use any sensible name, but remember what it is.
***(2) Use the same workgroup name as Windows XP (usually Mshome).
***(3) This is the shared folder you created earlier
***(4 & 5) This is the username you use for Windows XP. Don’t use spaces. If necessary, modify the username you use for your guest XP machine (Explorer->Control Panel->User Accounts).
10)Start samba:
sudo /etc/init.d/samba start
11)Add yourself as a samba user:
NOTE: You will be asked for a password – make sure you use the same as you use for login
sudo smbpasswd -L -a your_username sudo smbpasswd -L -e your_username
That’s all for samba, now for the Windows part:
12)In the Windows XP machine VM -> Settings -> Ethernet, I chose Nat
13)Find out the ip of your linux box and the vmware connections by typing ifconfig in a Ubuntu terminal. You will probably see 4 or more ip addresses. Write down each of the 4 (or more) inet addr addresses.
14)In the Windows guest machine:
– Click “START”
– Click “Control Panel”
– Click “Network Connections”
– Find your “LAN Connection”
– Right-click the icon and select “Properties”
– Select the “TCP/IP” Protocol and click the “Properties” button
– Click “Advanced”
– Select the third Tab entitled “WINS”
– Click “Add”
– Type in each of the ip addresses you copied down from 13) above & click “Add†for each one
– Select “Use NetBIOS over TCP/IP”
– Click “OK”
– Click “OK”
– Click “OK”
– Reboot the guest Windows
15)In the Windows guestmachine:
– Click “Startâ€
– Right-click “My Computerâ€
– Click “Map Network Driveâ€
– Choose a folder letter
– In the Folder field type \\Ubuntu (or the netbios name you chose)\MyFiles(the name chosen for the Ubuntu shared folder)
– Tick “Reconnect at logonâ€
– Press “Finishâ€
If all has gone well, whatever you see in the Ubuntu shared drive will be seen in the nominated XP drive. Copying or moving files from/to Ubuntu and the XP guest is now very straightforward.
I’ve given these instructions in good faith and they represent what I had to do to get my samba connection working between my Ubuntu partition and its Win XP VMWare guest. If they don’t work for you, I’m sorry but I doubt if there’s a lot I can do to help because I am very new to Ubuntu. and I had to struggle for more than a day to get this working. Huge Credits to Peturr for the Howto:VMWare installation, and to Stormbringer for his Howto:Setup Samba Peer to Peer from which I borrowed freely.
æ³¨ï¼šåŽŸæ–‡ä¸æåˆ°çš„System->Adminstration下的Shared Folder我没找到,为了便于ç†è§£æˆ‘装了一个samba的软件,从Add/Remove里装的。其实估计也å¯ä¸è£…。直接é…置就行了。
贴一下我的é…ç½®
[global] ;General server settings netbios name = Ubuntu workgroup = Workgroup announce version = 5.0 socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192 passdb backend = tdbsam security = user null passwords = true username map = /etc/samba/smbusers name resolve order = hosts wins bcast wins support = yes printing = CUPS printcap name = CUPS syslog = 1 syslog only = yes ; NOTE: If you need access to the user home directories uncomment the ; lines below and adjust the settings to your hearts content. ;[homes] ;valid users = %S ;create mode = 0600 ;directory mode = 0755 ;browseable = no ;read only = no ;veto files = /*.{*}/.*/mail/bin/ ; NOTE: Only needed if you run samba as a primary domain controller. ; Not needed as this config doesn't cover that matter. ;[netlogon] ;path = /var/lib/samba/netlogon ;admin users = Administrator ;valid users = %U ;read only = no ; NOTE: Again - only needed if you're running a primary domain controller. ;[Profiles] ;path = /var/lib/samba/profiles ;valid users = %U ;create mode = 0600 ;directory mode = 0700 ;writeable = yes ;browseable = no ; NOTE: Inside this place you may build a printer driver repository for Windows [print$] path = /var/lib/samba/printers browseable = yes guest ok = yes read only = yes write list = root create mask = 0664 directory mask = 0775 [printers] path = /tmp printable = yes guest ok = yes browseable = no ; Uncomment if you need to share your CD-/DVD-ROM Drive ;[DVD-ROM Drive] ;path = /media/cdrom ;browseable = yes ;read only = yes ;guest ok = yes [samba] path = /home/billyqiu/samba browseable = yes read only = no guest ok = no create mask = 0644 directory mask = 0755 force user = billyqiu force group = billyqiu available = yes public = yes writable = yes [Personal] path = /media/Personal browseable = yes read only = no guest ok = no create mask = 0644 directory mask = 0755 force user = billyqiu force group = billyqiu available = yes public = yes writable = yes [DATA] path = /media/DATA browseable = yes read only = no guest ok = no create mask = 0644 directory mask = 0755 force user = billyqiu force group = billyqiu available = yes public = yes writable = yes