Specifications

CHAPTER 4 Running Virtual Machines
135
Sharing Files Between Two Windows Systems
To share files between two Windows systems (where one machine is a host and the
other is a virtual machine, or both are virtual machines), be sure the file and printer
sharing service is installed for both operating systems and the folders you want to
share are marked as shared. Then you can browse from one system to the shared
folder or folders on the other system.
Sharing Files by Connecting to a Windows System from a Linux
System
To share files on a Windows system with a Linux system (by connecting to a Windows
host from a Linux guest or connecting to a Windows guest from a Linux host or
guest), you can mark a folder as shared on the Windows system, then use the
smbmount utility in the Linux system to mount the shared folder. For example, if you
want to share the folder C:\docs on a Windows 2000 system called win2k with a
Linux system at /mnt/docs, follow the steps below. You may want to set up a shell
script to run these commands.
1. Set up the folder or folders to share on the Windows system.
2. Create a user account on the Windows system for the Linux system user name
that you are using to connect to the Windows system.
Otherwise, if you know the user name and password for a user account that can
access the Windows system, you can specify that account on the command line.
3. From your Linux system, log on as root.
su -
4. Add the Windows systems host name and IP address to the hosts file, if the
system cannot be found by name.
5. Mount the Windows share on your Linux system. Enter the following command
all on one line.
mount -t smbfs -o username=<Windows system user
account>,password=<password> //win2k/docs /mnt/docs
(Substitute the appropriate host name, share and mount point for your systems.)
Note: If you do not want to expose this password on the command line or in a script,
leave out that option and provide the password when prompted after you run the
command.
Now you are connected to the shared folder on the Windows system from your Linux
system and can begin to share files between the two.