Tuesday, August 18, 2009

VirtualBox: Folder Sharing between Windows Host and Linux Guest

To start, you need to install the guest additions. I use Ubuntu Server 9.04 so I followed steps outlined in this post.

  1. install necessary tools for building kernel module by:
    sudo apt-get install build-essential linux-headers-`uname -r`
  2. Next, click on menu "Devices" -> "Install Guest Additions..." then mount the guest addition CD-ROM within the Linux virtual machine by:
    mount /dev/cdrom /media/cdrom0
  3. Finally, run the installation script:
    sudo ./VBoxLinuxAdditions-x86.run

If you do not have X server installed, you may see a warning message about the X driver will not be installed. Ignore this message and now we are ready to configure the shared folder.

  1. Create the a folder for sharing on the host Windows machine (say C:\Shared).
  2. Click on the menu "Devices" -> "Shared Folders..."
  3. Add a new machine level shared folder by clicking on the + icon on the right
  4. Enter "C:\Shared" for Folder Path and "shared" for the Folder Name.
  5. In Linux guest VM, create a folder /opt/shared and add the following line to the bottom of /etc/fstab:
    shared    /opt/shared    vboxsf    defaults    0   0
  6. Reboot the VM

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.