Configuring Virtualbox for Sharing and Mouse Control

You might have read my earlier article on installing Virtualbox in Ubuntu. I would like to explain couple of more features to use in Virtualbox. You can use these features once you install the virtualbox as explained here.

1. Sharing the folders between Ubuntu and Virtualbox Windows.

(Update: You may have to install Guest Additions as described in step 2 for sharing the folders too)

I would like to explain how to share your Ubuntu folders with Virtualbox. Thanks to Raja for the guide.

Update: If you are using the latest version of Virtualbox, you can try this instead of using the command line. Click the Settings icon in the Virtualbox window. Go to Shared Folder listed on the left side (as shown in the picture below). Click the small folder icon with a green + symbol on the right side next to Access column. Select the directory in your host OS that you want to access in the guest OS. In my case, it was the download and document directories.

Vboxshare 300x245

Click Ok. You need to install the Guest Additions as described in section 2. You can’t share folders if you don’t have guest additions installed. If you have installed it already, then start the guest OS (Windows), open My Computer, Click on Tools menu and select Map Network Drive. Select the drive letter you want under Drive: and the click Browse under Folder:. Expand VirtualBox Shared Folders as shown in the picture. Now select the directories from the list and click OK. You are all set.

Vboxshare1 300x227

If the above mentioned steps don’t work, then try this. Before you start the virtualbox, open a terminal in Ubuntu. Enter the following command:

VBoxManage sharedfolder add virtualmachinename -name “sharedfolder” -hostpath “/home/username/foldertoshare”

virtualmachinename is the name virtual machine you created. I created mine with the name WinXP.
username is your ubuntu home directory name. It’s usually /home/your user name.
foldertoshare is the name of the folder you want to share. In my case it’s Documents.
Here is the command I used.

VBoxManage sharedfolder add WinXP -name “sharedfolder” -hostpath “/home/arun/Documents”

Exit the terminal. Start the virtual OS now. Once you login to Windows, Click Start – Run and enter cmd.exe. Press Enter. You’ll get a terminal window. Enter the following command:

net use M: \\vboxsvr\sharedfolder

where M is the drive name you want to assign to the shared folder. Make sure the drive name is not used by Windows already. You will now see the shared folder as a network drive under My Computers.

2. Sharing mouse control between Ubuntu and Windows without using the control key.

If you want to share your mouse between Ubuntu and Windows (using Virtualbox) without pressing the right control key, you have to install the guest additions from the virtualbox menu. Once you start the virtual OS (Windows), press the right control key to get the mouse out of Windows control and click on Devices menu. Select Install Guest Additions (see picture below). This will install Guest Additions software in the Windows box. Once installed, reboot and login. You’ll get a warning message about the mouse control. Click OK and continue. You are all set. if you move the mouse over the virtualbox, then the control goes to virtualbox. If you move the mouse out of the box, then the control goes to Ubuntu.

Update: If you are using Virtualbox 3.0, you can try to install Guest Additions by clicking Devices -> Install Guest Additions. If it doesn’t work, then click Devices -> unmount CD/DVD-ROM and then click Install Guest Additions.

Update: With the new version of Virtualbox, the installation of guest addition is not straight forward. Here are the steps to follow if your guest OS is Windows. I installed Virtualbox in Ubuntu and installed Windows XP Pro as guest OS in Virtualbox.

After you started the guest OS using Virtualbox, Click on Devices menu and select �Mount CD/DVD-ROM” and then �CD/DVD-ROM image� under that. This will show you a window as shown below. You’ll see VBoxGuestAdditions.iso listed under that. If not, you have to look under C:\Program files\Sun\xVM VirtualBox in Windows or /opt/VirtualBox-1.6.2 or /usr/share/virtualbox/ in Linux. Click that ISO file and press the select button.

VirtualBox Guest Addition

VirtualBox Guest Addition

Then in the guest OS (Windows), open My Computer and double click the CD/DVD drive. For some people, double clicking the drive itself will bring you the guest additions installation wizard. For some, it’ll show the files under that and you have to double click Virtualbox guest additions setup.exe file. This will get you the wizard. Go with the defaults and complete the wizard. Once it’s completed, you have to reboot the system. The screen resolution might change after rebooting. Go and change the resolution by right clicking on Windows desktop and selecting properties. You should now be able to move the mouse between the host and guest OSes without pressing the right control key.

Guestaddon

Technorati Tags: , , , , , ,

This entry was posted in Ubuntu and tagged , , , , . Bookmark the permalink.

58 Responses to Configuring Virtualbox for Sharing and Mouse Control

  1. Ian says:

    Thanks for the great info. The mouse trick is much better than toggling back and forth. Used your instructions on a Mac to get windows running. Need to test IE6 and 7 unfortunately. Thanks again.

  2. Arun says:

    I have never tried Virtualbox with Ubuntu server edition. I think the best place to get help is Ubuntu Forums at http://ubuntuforums.org/

  3. Swaminathan says:

    I am trying to install Ubuntu server 9.04 (jaunty jackalope) with virtualbox service and windows 2003 guest OS on it, without an internet connection. Since I am familiar only with windows systems, I am finding it diffictult to use the console as also setting up proxy configuration(with user name and password) in the Ubuntu server. Can you guide me.

  4. Arun says:

    If you can give more information, then I can try figuring it out. What’s your host, what’s your guest and what did you try to do etc.

  5. Charlie says:

    lost the 1st note due to my bad typing. I am struggling with” shared folder path is not absolute. I may have a question and would love to have someone help me. Will you help if I can’t resolve this error in a day or so?? Thank you in advance

  6. Howard says:

    I’ve installed OpenSUSe 10 as my guest OS under virtualbox on my VISTA … The mouse driver says virtualbox mouse, but I still don’t have the ability to leave the guest window without using the control key.
    The screen resolution part works great.

    • Arun says:

      I’m not sure about Windows being host OS. It works for me whenever I installed Virtualbox after I installed the guest addon with Linux being the host.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>