May

07

Installing Virtualbox and Windows in Ubuntu

Posted by : Arun | On : May 7, 2007

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):

Vbgroup

(Manage Users)
Vbgroup1

(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.

Vbgroup2

(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.

Update: If you are using Ubuntu 8.04 Hardy Heron, refer to this instruction to modify the 40-permissions.rules file.

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.

Virtualbox1

(Virtualbox started)

Click on the New button on top left. You’ll see an installation wizard as show below:

Virtualbox2

(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.

Virtualbox3

(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.

Virtualbox4

(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.

Virtualbox5

(Hard drive)

It opens another Wizard to allocate hard drive space as shown below. Click Next

Virtualbox6

(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.

Virtualbox7

(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.

Virtualbox8

(disk size)

Click Finish in the next step to finish the virtual disk creation and Click Finish again to finish the Virtual OS creation.

Virtualbox9

(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.

Virtualbox10

(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.

Virtualbox11

(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.

Virtualbox12

(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 or Ubuntu Hardy Heron, 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

If you are using Ubuntu 8.10 Intrepid Ibex, You won’t find those lines. Add those lines inside do_start() function before closing }. The file should look like this:

do_start () {
#
# Mount a tmpfs on /dev/shm
#
SHM_OPT=
[ “${SHM_SIZE:=$TMPFS_SIZE}” ] && SHM_OPT=”,size=$SHM_SIZE”
domount tmpfs shmfs /dev/shm tmpfs -onosuid,nodev$SHM_OPT

#
# Mount /dev/pts. Master ptmx node is already created by udev.
#
domount devpts “” /dev/pts devpts -onoexec,nosuid,gid=$TTYGRP,mode=$TTYMODE

#
# Magic to KEEP /proc/bus/usb working
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs “” /dev/bus/usb/.usbfs usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount –rbind /dev/bus/usb /proc/bus/usb

}
case “$1″ in
“”)

If you are using Ubuntu 8.10 Intrepid Ibex, type the following command in a terminal:

grep vboxusers /etc/group

You should see something like this

vboxusers:x:123:username

Open the fstab file by issuing the following command:

sudo gedit /etc/fstab

Add the following line

none /proc/bus/usb usbfs devgid=123,devmode=664 0 0

Save and exit.

Reboot and continue with the rest of the setup.

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.

Virtualbox13

(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: , , , ,

Comments (123)

  1. TechLW said on 06-02-2012

    Really nice,
    very cool sharing.

  2. […] Proxmox VE, Another Awesome Virtualization PlatformLinux container-based virtualization with OpenVZInstalling Virtualbox and Windows in Ubuntu – Aruns BlogOpenVZ with proxmox howto:Proxmox 1.9 “Virtual Environment” duyuruldu.Ubuntu 10.04 OpenVZ […]

  3. kiran said on 15-06-2011

    hi arun
    i am running ubuntu 11.04 and i successfully installed the ubuntu 8.04 with virtual box 4.07r71778; nut unable to install any windows versions, I get error”no bootable medium found”
    please help

  4. […] Simple Man, A Complex Mind » UbuntuRunning Vista Inside VMWare on Ubuntu– The Glass is Too BigInstalling Virtualbox and Windows in Ubuntu: Arun's BlogInstalling Guest Additions For Ubuntu Guests in VirtualBox […]

  5. […] followed the instructions on this page, and it worked perfectly for me. So some of you might have similar needs, so can give it a try when […]

  6. vishal said on 07-08-2010

    for more on installation and configuration of virtualbox follow the link..

    http://infinitevishal.blogspot.com/2010/08/installation-of-virtual-os-with-help-of.html

  7. […] – Vì cùng một chương trình nên các bước tạo máy ảo và cài đặt Windows lên máy ảo diễn ra tương tự như đã trình bày ở mục 1.a bên trên. Bạn có thể tham khảo thêm hướng dẫn tại http://www.blog.arun-prabha.com/2007/05/07/installing-virtualbox-and-windows-using-virtualbox-in-ubu…). […]

  8. PHiL said on 18-12-2009

    i have ubuntu 9.1 how do i allow the USB for this distribution?

    • Arun said on 18-12-2009

      My initial try to enable the USB messed up the system. I haven’t tried it again in Ubuntu 9.10. I might do it during the holidays. I’ll let you know if I figure out how to do it.

  9. […] screen error the first couple of times I tried to install Windows XP Home, I found the instructions here. In particular, the post suggests adding this line none /proc/bus/usb usbfs devgid=000,devmode=664 […]

  10. […] I recently read about the latest release of VirtualBox, version 1.5.2, which comes with a new feature called seamless windows. This is a very cool feature which makes VirtualBox edge closer in functionality to Mac’s Parallels. In order to get some tips on installing VB I used this article. […]

  11. […] – Vì cùng một chương trình nên các bước tạo máy ảo và cài đặt Windows lên máy ảo diễn ra tương tự như đã trình bày ở mục 1.a bên trên. Bạn có thể tham khảo thêm hướng dẫn tại http://www.blog.arun-prabha.com/2007/05/07/installing-virtualbox-and-windows-using-virtualbox-in-ubu…). […]

  12. […] 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 […]

  13. Alex said on 27-04-2009

    Thanks for your tips on USB regarding Ubuntu.

    I have the same problem,my system is Ubuntu Jaunty and guest windows xp.VirtualBox2.2

    Can you please give suggestions to solve this problem to detect usb/ipod in windows xp,which is my guest os.

    Much appreciated thanks.

  14. Arun said on 06-04-2009

    Rahul,

    The second paragraph of my post says “Go to Virtualbox download site and download the binary file compiled for your OS.” This implies what you wrote.

  15. Rahul Goyanka said on 05-04-2009

    For intrepid, i had to do install the latest virtualbox 2.1.4 beyond what is given on this blog to enable usb option. Without that virtualbox doesn’t show the usb option. Something worth putting in blog i guess. To install virutalbox 2.1.4 one can follow http://www.virtualbox.org/wiki/Linux_Downloads link

  16. MickPatten said on 22-12-2008

    Arun,

    I had a similar issue with my WinXP client.

    I know it’ll seem simple – but this worked for my guest re-sizing issue;

    Have you tried minimising the client window in Ub, then restored it and clicked the “Auto Resize Guest Display” under the “Machine” menu?

    Can’t help with the video driver style issue – i have the same thing when I tell my XP guest to “restart”, yet “shutdown” works fine! :S go figure! (hopefully soon i can leave it permanently shut-down!!!)

    Michael.

    • Arun said on 23-12-2008

      I didn’t try that. What I do now is increase the screen resolution in Windows to get the screen bigger. It works for me since I don’t start Windows quite often.

  17. Arun said on 08-10-2008

    Robin,

    This is what I have in my 40-permissions.rules.
    # USB serial converters
    SUBSYSTEM==”usb_device”, GOTO=”usb_serial_start”
    SUBSYSTEM==”usb”, ENV{DEVTYPE}==”usb_device”, GOTO=”usb_serial_start”
    GOTO=”usb_serial_end”
    LABEL=”usb_serial_start”
    ATTRS{idVendor}==”0403″, ATTRS{idProduct}==”6001″, \
    ,GROUP=”vboxusers”, MODE=”0666″, GROUP=”dialout”
    LABEL=”usb_serial_end”

  18. Robin B said on 06-10-2008

    Thanks.
    Well, I haven’t tryed install Windows yet, but everyting works so far.

Leave a Reply

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


*

winrar download free

winrar download free

download winrar free

download winrar free

winzip activation code

winzip activation code

free winrar download

free winrar download

windows 7 ultimate product key

windows 7 ultimate product key

winzip registration code

winzip registration code

windows 7 key generator

windows 7 key generator

winzip free download full version

winzip free download full version

windows 7 product key

windows 7 product key

free winzip

free winzip

windows 7 activation crack

windows7 activation crack

winrar free

winrar free

winrar free download

winrar free download

winzip free download

winzip free download

winzip freeware

winzip freeware

free winrar

free winrar

windows 7 crack

windows 7 crack

windows xp product key

windows xp product key