Installing Virtualbox and Windows in Ubuntu
I have successfully installed Virtualbox in my Ubuntu Feisty Fawn desktop. Installation was pretty simple. Configuration and installing Windows took some time. I'm listing the steps I followed to get it installed and configured.
How to install Virtualbox in Ubuntu Feisty Fawn:
Go to Virtualbox download site and download the binary file compiled for your OS. I installed it on Ubuntu Feisty Fawn, so my tutorial is based on Feisty Fawn installation. I downloaded the binary package for Feisty Fawn from here. Open a terminal after the download is complete. Go to the folder where you downloaded the file. Enter the following command to install Virtualbox.
sudo dpkg -i filename (in our case it's VirtualBox_1.3.8_Ubuntu_feisty_i386.deb).
This should install Virtualbox in your system. Once the installation is complete, you can start the Virtualbox by going to Applications -> Systems -> Innotek Virtualbox. Before you start using Virtualbox, go to System -> Administration -> Users and Groups. Click on Manage Groups button on the right. Scroll down until you see vboxusers in the list (see below):
(Vboxusers)
Click on Vboxusers and click Properties button on the right. You'll see a screen as shown below with the list of users. Check the users to whom you want to give access to Virtualbox. Click OK and close the boxes.
(Vboxuser group)
Once you attach the Vboxusers group to the users, change permission to access USB devices. Open a terminal and enter
gksudo gedit /etc/udev/rules.d/40-permissions.rules
Change the line that says
SUBSYSTEM==»usb_device», MODE=»0664»
to
SUBSYSTEM==»usb_device», MODE=»0666»
Save and reboot your system. Once logged in, start Virtualbox from the menu. You'll see a screen similar to one shown below. My screen is blank because I deleted the default one. You can use either the default one or you can create a new one. I'm going to explain how to create a new one.
(Virtualbox started)
Click on the New button on top left. You'll see an installation wizard as show below:
(Installation Wizard)
Click next. Enter a name for the virtual machine. I gave WinXP to show it's Windows XP installation. Select the OS type you want to install. It's Windows XP in my case. Click Next.
(Name and OS type)
The next screen is where you allocate memory to the virtual machine. I have 1GB RAM, so I allocated 512MB to the virtual machine. The more the better, but then it might slow down your Ubuntu installation if your virtual machine memory allocation is more than Ubuntu's. Click Next.
(Memory Allocation)
The next step allows you to create a virtual hard drive for the virtual OS. You can create a new one or use an existing one, if you had already created one. It's going to be a new one in my case, so I selected New.
(Hard drive)
It opens another Wizard to allocate hard drive space as shown below. Click Next
(New wizard)
Now you have two options to create a virtual drive. The first option is to dynamically expand the space and the second one is to create a fixed size. If you have enough space, then select the first option. You still have to allocate the maximum space, but it'll fill that as it gets filled. You can't allocate 1GB and think it'll add more space as it needs. It didn't work like that for me the first time I created. I created with 2GB and thought it would add more as it needs, but it errored out due to lack of space (it filled the 2GB) even before the SP2 installation could complete. I think it takes more space from the allocated space as it needs. The fixed size image option takes the entire space at one time. I went with the 1st option. Click next after you choose whichever option you want.
(disk option)
Now give a name for the virtual disc image file and select the size you want to allocate. I gave the name as WinXP, so it created a file called WinXP.vid. I allocated 6 GB. Click Next.
(disk size)
Click Finish in the next step to finish the virtual disk creation and Click Finish again to finish the Virtual OS creation.
(Finish)
Now comes to OS installation part. Before you install the OS, Click on the virtual machine you just created and click on the settings button on top. It'll show you all the configurable settings. Under the general setting, you can resize the RAM settings and you can also adjust the video memory setting. I have 256MB video card, so I allocated 128 MB for video.
(general setting)
Click on CD/DVD-ROM on the left side. Once you are there, Check Mount CD/DVD drive and select your CD/DVD drive from the drop down box. My default CD drive is /dev/cdrom, so I selected that. I had problem with Edgy when I tried to install Virtualbox in Edgy. Virtualbox didn't detect my CD drive. I didn't have that problem with Feisty version.
(CD drive)
The next step is Audio. Click on Audio on the left side. I'm not sure if this step is needed, but I did it anyway. It may work without doing this step. Check Enable Audio and select ALSA Audio Driver.
(Audio)
Click on the USB option. Check Enable USB Controller. Click on the tiny USB cable icon with small green dot on the right. It'll show you all available USB devices. Add those to the filter (picture below). This won't load the USB devices automatically when you boot the virtual OS, but it'll give you an option to load them when you want.
Update: If you are using Ubuntu Gutsy Gibbon, Ubuntu removed support for /proc/bus/usb/*. Open a terminal and enter
sudo gedit /etc/init.d/mountdevsubfs.sh
Go to the lines as shown below:
#
# Magic to make /proc/bus/usb work
#
#mkdir -p /dev/bus/usb/.usbfs
#domount usbfs «» /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
#ln -s .usbfs/devices /dev/bus/usb/devices
#mount --rbind /dev/bus/usb /proc/bus/usb
Uncomment the last 4 lines and make it look like below:
#
# Magic to make /proc/bus/usb work
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs «» /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb /proc/bus/usb
Close and restart virtualbox. You should see the USB options in the settings. You can add the devices you want. Thanks to Virtualbox for the information.
(USB)
Click OK. You are now ready to start the installation of virtual OS. Put the Windows XP installation CD in the CD drive. Select the virtual machine you created from the Virtualbox and click the Start icon on top. It'll start the installation of Windows. Windows installation will show you the virtual disk as the disk to install. Format it and install the OS. Once the installation is done and you login, you can select the USB devices you want to install from the menu. Select mount option from the VM menu and select the USB devices you want to mount.
Virtualbox starts the virtual OS in a small window. You can run it full screen by selecting full screen in the menu. Once you click on virtual OS, the control of your mouse, keyboard and USB devices go to the virtual OS. If you want to get the control back to your Ubuntu box, click the CTRL key on the right side of the keyboard. This will give the control back to the original OS.
I hope this helps you to setup your virtual machine. If you have any suggestion, please leave a comment. I felt Virtualbox is little slower compared to VMWare server and also slowed my Ubuntu machine a little bit, but the real advantage are, Virtualbox is open source and it supports USB devices like webcam without paying $$$s.
Update: Read my post Configuring Virtualbox for sharing and mouse control for more configuration options.
Technorati Tags: Ubuntu, Virtualbox, Windows, OS, VMWare
















64 comments
1 year and 1 month ago
The easiest way is to install virtualbox is through Automatix2.
Setting up a guest OS is just like how you would do it in VMWare or Virtual PC which is really easy.
1 year and 1 month ago
Well done arun. You are on digg now
1 year and 1 month ago
ooh i hate when the security code screws up and makes me start over, and my well-thought-out comments are lost. I am not going to retype them, but i was looking for a clarification on the «If you want to get the control back to your Ubuntu box, click the right control button» comment -- just where is that button??
1 year and 1 month ago
@lefty.crupps:
that little bit about the «right control button» is a little misleading... i was confused after running virtualbox the first time. i ended up killing it with the «X» button on the window.
the next time i ran it i accidently touched the «ctrl» key on the right side of my keyboard and all of a sudden i was back controlling my Ubuntu windows -- no longer captured...
try tapping the «ctrl» key and see if it works for you...
dennis
1 year and 1 month ago
arun -
thanks for the stuff on how to make USB work!! that will save me some time since i run photoshop cs2 on win2k using virtualbox...
good stuff!!
1 year and 1 month ago
I keep getting errors,
cannot access archive: No such file or directory
errors were encountered while processing.
I've redownloaded about 5 times and downloaded one to my windows box and transfered it by flash drive. Still I get the same error each time. And yes, I also double checked to make sure I typed it all correctly.
1 year and 1 month ago
Followed the instructions to the letter. Installing in feisty, it fails to add /lib/modules/2.6.20-15-generic/misc/vboxdrv.ko. The end result was that I could run the program and set up the VM, but once I tried to run the VM it made a fatal error and crashed the program.
This is a nice, easy to follow guide, but I wouldn't recommend trying it because of the file problems.
1 year and 1 month ago
How about Host networking? I cant even receive files using NAT through msn. Did some guide but got confused haha any help there?
1 year and 1 month ago
A couple of comments. An important step that you missed is the installation of the guest add-ons, which installs the necessary drivers in the guest and allows better host-guest interactions. You wont need right control key anymore.
The other is to set up a shared folder. It is a little more tricky but more robust compared to vmware.
I think you are allocating too much RAM to the guest, That is what is making your ubuntu system slower. It runs perfectly on my machine with no effect on the host speed at all.
1 year and 1 month ago
Why did you use VirtualBox, and not KVM? I beleive it's supposed to give a better preformance (with recent hardware that support virtualisation, that is), as it's allowing direct access to the hardware, instead of a «translation-layer».
1 year and 1 month ago
I just installed Virtualbox on Gentoo and Windos XP just runs like it would be installed natively. VirutalBox is a really great product what I can tell so far! Does not run on 64bit arch's yest ;(
1 year and 1 month ago
Thanks Vivek.
Crupps, sorry for the security code screw up. As Dennis explained, it's the right side CTRL key.
Dennis, I updated the post with more clear explanation of CTRL key.
Dyllon and Nate, I'm not sure why you are getting those errors. I didn't get any during my installation.
Nyx, I didn't try host networking. I'm not sure how to proceed.
Raja, I would appreciate if you can give me more details on how to install guest addons and creating shared folders. I would like to transfer files between the guest OS and Ubuntu. Any help to achieve that will be appreciated.
Bl4deRunner, there is no specific reason not to install KVM. I installed VMWare server first, but usb devices won't work with that. Virtualbox was open source and supports usb devices, so I installed that. If you can point me to KVM installation guide, then I'll give it a try. Does it support webcam, external hard drive etc?
1 year and 1 month ago
I did have host networking running under 6.10 with XP. When I upgraded to 7.04, it would not work and have not been able to get it working since.
1 year and 1 month ago
Great tutorial, thanks.
The info on how to make USB work is really handy for me as I have a fairly small Partition and use USB keyrings and an external hard drive for a lot of my data.
1 year and 1 month ago
You are welcome SEO.
1 year and 1 month ago
Arun,
'Install guest-addons' is accessible from the menu in virtualbox. It is an absolute must to vastly improve the user experience. The details on creating a shared folder and mentioned in the manual, but you can also look them up in my tutorial here - http://reachbeyondgrasp.blogspot.com/2007/04/how-to-install-virtualbox-in-ubuntu.html
1 year and 1 month ago
Thanks Raja. I'll try that.
Do you know how to come out of fullscreen? I started it in full screen and when I press the right ctrl key, i get the control out of Windows, but still Windows stays as full screen. I'm not able to go back to Ubuntu box. It starts in full screen the next time i start virtualbox. Any suggestion?
1 year and 1 month ago
Why not just use vmware? Sure it's not open source but I know it will work 100x better.
1 year and 1 month ago
vmware doesn't recognize usb devices unless you buy the latest vmware workstation.
1 year and 1 month ago
Motorcycle guy,
Having used vmware for a long time and recently switched to virtualbox, I can assure you that virtualbox is not only opensource, it is a little faster, and leaner.
However, Arun, you can use USB devices on vmware without purchasing anything.
1 year and 1 month ago
Hi,
Worked great for me, but I got one problem, I don't seem to get my mouse back, when using 'right CTRL' key, I get the keys back but not the mouse. The same happens when I shutdown the Vbox, I need to execute a couple of modprobe commands to get the mouse to working, any ideas?
I got a logitech wireless mouse using USB
Thanks,
K
1 year and 1 month ago
I didn't try with wireless mouse, but I use wired USB mouse. Did you add your mouse through virtualbox menu Devices - USB Devices - and then your mouse? If so, don't do that. I did that for my keyboard and I couldn't get the keyboard control out. Once I unchecked my keyboard from the USB devices menu, it worked fine. If you have your mouse added through that, uncheck it. Your mouse should work normally.
1 year and 1 month ago
Hi Arun.. I'm currently having to hard disk.. primary HD i installed winXP and the second HD I installed feisty. My question is how do I open my windowXP in ubuntu. Thank you
1 year and 1 month ago
I don't think you can run the XP you installed in the 1st hard drive through Virtualbox. You have to install XP inside the virtualbox to run it. I think VMWare might allow you to do that, but I'm not sure.
1 year ago
I installed a windows 2000 guest within an UBuntu host. Following notes based on experience:
1. Virtualization needed to be enabled in the bios. Without this Virtual Box would essentially not launch.
2. If you are attempting to install using a combination of floppies and non-bootable CD you might have to share the floppy drive as «a:» in Linux. A better alternative is to create a bootable CD.. see http://www.nu2.nu/bootcd/
3. Do NOT enable the «Enable IO APIC» option, as the Windows installation will hang about 1/3 the way through. Enable ACPI seems to be okay, but I am not sure if it accomplishes anything.
4. Before installing you must execute the following from a terminal Window within linux:
VBoxManage setextradata «VBoxInternal/Devices/piix3ide/0/Config/IRQDelay» 1
If you don't, the installation hangs after the installation of network files. When done with the installation, execute
VBoxManage setextradata «VBoxInternal/Devices/piix3ide/0/Config/IRQDelay» 0
5. I tried with a dynamic expandable and fixed size virtual drive and both are equally buggy.
Whoever did the front end on the Virtual Box was really a good designer and coder. The back end unfortunately, at least in my experience, seems to be lacking. In general, when running Windows within VirtualBox, the application does not like large files (either moving the files around or opening with an application) and frequent crashes are encountered. (I am probably wrong, but I suspect it just does not handle well files larger than 16 MBytes and that its a 24 bit address issue. I had the file system set as NTFS within the virtual hard drive.) Whats more, the applications (probably by necessity) do not appear to run in their own protected space within the virtual operating system; if one app crashes it will generally bring the whole virtual operating system down.
1 year ago
Thanks for sharing the information Citrin. I hope they fix those issues soon. They are doing a pretty good job.
10 months and 26 days ago
i had to install the following dependencies before i was able to install virtualbox:
virtualbox depends on libxalan110;
virtualbox depends on libxerces27;
10 months and 25 days ago
Bob,
I installed Virtualbox 1.3.x in Ubuntu Feisty and Virtualbox 1.4 in Feisty and Gutsy Gibbon and I didn't have any dependency problem.
Thanks for the information in case others have dependency problem.
Arun.
10 months and 11 days ago
I was happily installing a vbox on my laptop when I realized that my laptop does not have a right CTRL key on the keyboard! I tried plugging in a USB keyboard, then realized the compact keyboard I had does not have a right CTRL key either. It seems that the best option at that point is to try to shut down the guest OS somehow.
10 months and 11 days ago
Jonathan,
I think you can set the key to something else other than right CTRL key in the settings. Check the settings before you start the virtual OS. I'm not sure where to set that, but I remember seeing an option to do that.
9 months and 25 days ago
hi there,
this post (and the one regarding sharing folders and mouse) is absolutely GREAT!!. Thank you very much!!. By the way this virtualbox thing is very cool ahh!
cheers
9 months and 24 days ago
You are welcome pepe. It's pretty cool.
9 months and 20 days ago
hi there,
how can I make an 'access-direct' to my wirtual-box-winXP??, I mean, i already have to first to open VirtualBox, then hit 'start' in WinXP, and then appear WinXP, but i was wondering if this can be reduced to just one line or key.
thanks in advance
9 months and 18 days ago
I have no idea how to do that. If anyone knows how to do it, please leave the steps in the comment.
9 months and 16 days ago
@pepe - You can create a launcher for a specific WM with the following command:
VirtualBox -startvm «Name of Machine»
i.e. VirtualBox -startvm «Windows XP SP2» in my case. I even went so far as making a little windows icon for my taskbar to launch it. The irony of opening Windows and flippiing it around in a Mac-like Coverflow task switcher on a Linux O/S is just delicious
8 months and 14 days ago
I have successfully installed VirtualBox (v1.5.0). I am using Ubuntu 7.04 - the Feisty Fawn - released in April 2007. But when I am trying to start windows installation I get the following error.
Unknown error initializing kernel driver (VERR_VM_DRIVER_VERSION_MISMATCH).
VBox status code: -1912 (VERR_VM_DRIVER_VERSION_MISMATCH).
Result Code:
0x80004005
Component:
Console
Interface:
IConsole {1dea5c4b-0753-4193-b909-22330f64ec45}
Can anybody tell me how to overcome this error??????????????
Thanks in advance
8 months and 13 days ago
Arnab,
From what I found, If your installation has old kernel driver. To solve this, open a terminal and type the following 2 commands and start the virtualbox.
rmmod vboxdrv
modprobe vboxdrv
8 months and 4 days ago
Thanks for this great HOWTO! The section about Gutsy and USB provided me with help to set up my scanner in VirtualBox again. Thanks!
8 months and 4 days ago
You are welcome Skydancer.
8 months and 1 day ago
I installed Virtualbox via Synaptic under Gutsy, and made the changes Arun mentioned so it could see USB.
Several attempts to install winxp failed because it kept hanging up when it came time to «format the disk» It seemed like some kind of buffer or memory problem (??) because it got to 20% formatted before hanging when I tried «quick FAT» rather than the default it was selecting (regular NTFS). Then formatting would hang right from the start.
What finally worked was setting memory allocated to Windows at 256MB (I have a total of 1GB and had been giving it 512) and selecting «NTFS Quick format». I'm not sure which of those two did the trick, or whether both were needed. By then, I wasn't in the mood to start over yet again!
USB thumbdrive doesn't show up as a mounted drive, the way it should judging by Arun's screenshots. But I can define it as a shared folder in vbox Settings. I still haven't found where I can access it in WinXP. I ran «net use c:\\vboxsvr\my-share-name» but that hasn't done anything noticeable. A project for another day....
8 months ago
Quixote,
The one in Synaptic is open source edition. It doesn't support USB. You have to download from Virtualbox site. See my post
http://www.blog.arun-prabha.com/2007/10/26/usb-not-working-with-virtualbox-in-ubuntu-7-10-gutsy-gibbon/
I'm not sure about the reason for your formatting problem. Both 512 and 256 worked for me.
7 months and 29 days ago
Hi Arun!
Yes, I saw that post and changed the usb settings the way it is in the post you linked to. Before that it couldn't see the usb at all. After that, I could define it as a shared folder, at least, which has to be a good sign (?). I haven't played with it in the meantime.
(But having virtualbox-winxp-ie has already saved me from major aggro with my stupid ISP whose customer service site only works under IE.... One of those good news - bad news situations. ;-))
7 months and 12 days ago
To give you a little background. I recently purchased a Dell with Ubuntu on it. It perfectly fits my needs except for the webcam. I use Skype Video on a regular basis, and Skype didn't recognize my webcam Creative Live, even though the webcam works with Ekiga. From what I read there is a bug somewhere that is currently being worked on.
Anyway. I decided to give vritual windows a shot. I followed the instructions above and th installation worked as a charm. Thanks a lot. However, my virtual windows still doesn't see my webcam. It does however, recognize my printer hooked up via USB. So USB ports do generally get picked up. At this point, my next stop is a dual boot system, but I was hoping if there were something I have missed. Any help would be greatly appreciated. Thank you!
7 months and 12 days ago
Skender,
A silly question, Does the USB Devices in the virtualbox menu show your usb webcam? Sometimes the usb devices will be detected, but won't be loaded unless you select them manually from the menu. Since it detected your printer, I assume that you are not using the open source version of Virtualbox. I'm not sure what else could be the problem. If the usb camera is detected by the vitrualbox, but not working in Windows, then it could be thee driver problem too.
7 months and 11 days ago
Arun,
Thanks a lot for your response. I actually fixed the problem. VirtualBox documentation (page 117 I think) helped me change some settings. Now USB is recognized and I could get my skype video working. Thank you so much for your excellent how-to.
Skender
7 months and 11 days ago
You are welcome Skender. I would appreciate if you could leave a comment on how you fixed it, so it'll help for future reference.
7 months and 8 days ago
Hi Arun
Thanks for a great tutorial - worked 1st time perfectly (feisty fawn) - and considering I'm only 'aspiring' to become a newbie on linux is a testement to your tutorial skills.
Mariner
7 months and 8 days ago
Hi Arun
Further to my last comment, there was just one small thing that I would like to ask you - how do I make the guest os into a full screen - I have f/f as my main os and have winxp as guest - if I increase the resolution settings in winxp then it cuts off the start button bottom left - any suggestions ?
Mariner
7 months and 7 days ago
I forgot how I did that. I don't have Ubuntu system with me now. I'll check when I go home and get back to you. Did you try installing the Guest Addon? If not, refer http://www.blog.arun-prabha.com/2007/05/21/configuring-virtualbox-for-sharing-and-mouse-control/
Guest addition might help you to maximize the virtual OS screen by normal way (just how you maximize any application in Ubuntu or Windows.
6 months and 20 days ago
Thank's a lot!!!
I searched all over the internet and this is the only tutorial that shows me a guide I want!!!
6 months and 19 days ago
You are welcome Erik.
5 months and 17 days ago
It looks like the usb hack does not work in hardy.
I have VB running perfectly in gutsy.
5 months and 17 days ago
I didn't try it in Hardy yet.
4 months and 3 days ago
nice guide... actually setting it up as i type this.. so i'll post again to my successes and problems
4 months and 2 days ago
Chack, How did it go?
3 months and 25 days ago
Everytime I try to enter the Settings screen, I get this error:
Could not load the Host USB Proxy Service (VERR_FILE_NOT_FOUND). The service might be not installed on the host computer.
Result Code:
0x80004005
Component:
Host
Interface:
IHost {81729c26-1aec-46f5-b7c0-cc7364738fdb}
Callee:
IMachine {31f7169f-14da-4c55-8cb6-a3665186e35e}
Any ideas?
3 months and 25 days ago
D-Rab,
If you installed Virtualbox through Synaptic, which is an open source version, then it won't support USB. If you downloaded it from Virtualbox site, then try the procedure in the update section in this guide.
Arun.
3 months and 24 days ago
Very good guide Very helpfull I setup my VMB following your guide,Thank you very much
3 months and 23 days ago
You are welcome Joe.
2 months and 15 days ago
I love the tutorial, I have one issue with my installation. I cannot get my VM to capture my mouse. I cannot control anything. I am using my laptop mouse and I just cannot get it to work. Any ideas on what this is? I would appreciate it. I had to tab the whole installation, but I need the mouse for the XP GUI! LOL
Thanks for any input!!!
2 months and 15 days ago
Also,
how do I get the video to FULL SCREEN? I click full screen and it still the same size just the black boxes around are still there. It is frustrating.
2 months and 14 days ago
Artic,
I'm not sure why it's not taking control of your laptop mouse. What happens when you click inside the virtual machine window? See if you can get the mouse to work by installing the Guest Addon as given here
http://www.blog.arun-prabha.com/2007/05/21/configuring-virtualbox-for-sharing-and-mouse-control/
I
I couldn't get the full screen to work properly, so what I do is, I increase the screen resolution inside the virtual OS.
2 months and 1 day ago
Not sure what the issue is. I have virtualbox on my XP os and it works great when I do the mouse. I found that the screen is still does not enlarge on the PC as well. Also, can anyone tell me why Icannot get win98,95 or me loaded on virtual box? It is not only an Ubuntu issue either. Everytime I load the os's, they video is scrambled. It never popps up to the desktop, it just has a bunch of colors, like there is a video issue. Doesn't matter what OS I use, it comes out the same way.
2 months ago
I'm sorry Artic. I'm not sure how to fix your issue. I also don't have Win 98 or Me to test.
Write a comment
If you want to add your comment on this post, simply fill out the next form:
* Required fields
You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>.
34 trackbacks
To notify a mention on this post in your blog, enable automated notification (Options > Discussion in WordPress) or specify this trackback url: http://www.blog.arun-prabha.com/2007/05/07/installing-virtualbox-and-windows-using-virtualbox-in-ubuntu/trackback/