Ubuntu Geek

Ubuntu Linux Tips,Howtos&Tutorials|Edgy,Feisty,Gutsy,Hardy

  • Subscribe RSS Feed

    subscribe to the ubuntu Geek RSS feed




  • Sponsor

  • Categories

  • Meta

  • Sponsor

  • Archives



  • WidgetBucks - Trend Watch - WidgetBucks.com

Create and Manage Virtual Machines Using VirtualBox

Posted by admin on January 18th, 2007

VirtualBox is a general-purpose full virtualizer for x86 hardware. Targeted at server, desktop and embedded use, it is now the only professional-quality virtualization solution that is also Open Source Software.

Install Virtualbox in Ubuntu Gutsy

If you want to install Virtualbox in Ubuntu Dapper,Edgy,Feisty,Gutsy you need to download the latest .deb package from here if you are using Ubuntu dapper you need to download the appropriate package from this link.In this example i am showing how to install virtualbox in Ubuntu edgy.
Preparing Your system

First you need to install the following packages

sudo apt-get install libxalan110 libxerces27

wget http://www.virtualbox.org/download/1.5.4/virtualbox_1.5.4-27034_Ubuntu_gutsy_i386.deb

Once you download the package you have virtualbox_1.5.4-27034_Ubuntu_gutsy_i386.deb file

Install.deb file using the following command

sudo dpkg -i virtualbox_1.5.4-27034_Ubuntu_gutsy_i386.deb

At the time of installation if you have any dependency problems like the following errors

Selecting previously deselected package virtualbox.
(Reading database … 174459 files and directories currently installed.)
Unpacking virtualbox (from virtualbox_1.5.4-27034_Ubuntu_gutsy_i386.deb) …
dpkg: dependency problems prevent configuration of virtualbox:
virtualbox depends on libxalan110; however:
Package libxalan110 is not installed.
virtualbox depends on libxerces27; however:
Package libxerces27 is not installed.
dpkg: error processing virtualbox (–install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
virtualbox

If you see the above error message you can use the following command to install all the required dependencies

sudo apt-get -f install

This will complete the installation

Starting the VirtualBox Graphical User Interface

If you want to start Virtualbox GUI use the following command from your terminal(Applications—>Accessories— >Termianl)

VirtualBox

Once it opens you should see the following screen

VirtualBox Version Details

Creating a Virtual machine

If you want to create a Virtual machine you need to click on “New” button in the user interface will guide you through the new virtual machine

Now the following wizard will appear click next

In the next screen You nees to select VMname and OS Type and click next

Now you need to select the memory for your VM

Here you need to select the Virtual hard disk details and click next

Summary of your Virtual Machine and click finish

Once you click on finish You should see the following screen

If you want to start this VM you need to click on “Start” in the user interface

This is virtualbox installation in ubuntu edgy and also explains how to create a new virtual machine now you can install whatever OS you want to test.If you want more information on virtualbox check here

If you want to be notified the next time we write something please subscribe to our RSS feed.Thanks for Visiting!

Related Articles

47 Responses to “Create and Manage Virtual Machines Using VirtualBox”

  1. Eric Lake Says:

    This command did not work for me:
    sudo apt-get install VirtualBox_1.3.2_Ubuntu_Edgy_x86.deb
    To get it to install (from terminal) I instead had to use:
    dpkg -i VirtualBox_1.3.2_Ubuntu_Edgy_x86.deb

    Thanks for introducing this. It looks very cool.

  2. Marius Scurtescu Says:

    Getting the following error:
    No precompiled module for this kernel found -- trying to build one
    Messages displayed during module compilation will be logged to /var/log/vbox-install.log
    Compilation of kernel module failed, aborting installation
    dpkg: error while cleaning up:
    subprocess post-installation script returned error exit status 1
    Errors were encountered while processing:
    VirtualBox_1.3.2_Ubuntu_Edgy_x86.deb

    And at this point I cannot install or uninstall, completely stuck :-(

    The /var/log/vbox-install.log file contains:
    make: Entering directory `/opt/VirtualBox-1.3.2/src'
    Makefile:42: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again.. Stop.
    make: Leaving directory `/opt/VirtualBox-1.3.2/src'

    Shouldn’t the .deb file reference whatever kernel sources it needs (so they get installed)?

    Also, running sudo apt-get -f install will generate:
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: The package virtualbox needs to be reinstalled, but I can't find an archive for it.

    Any suggestions?

    Thanks,
    Marius

  3. admin Says:

    you are running two instances of package installations check the process and kill it using ps -ef

  4. Marius Scurtescu Says:

    I don’t think it is that. Even rebooted my machine. Now synaptic is completely hosed, running any search will return right away with no results. Damn virtualbox :-(

    Also, apt-get keeps saying “The package virtualbox needs to be reinstalled, but I can’t find an archive for it.”.

    I should probably install the sources for my kernel, but with synaptic being hosed not sure how to do that. This hopefully would allow the installation of virtualbox to complete properly.

    Now for every single apt operation I get subprocess post-installation script returned error exit status 1, cannot even forcefully remove virtualbox. It seems to call the same script even for remove.

  5. snauth Says:

    I would try this:
    Find out your kernel version with
    uname -r
    Download the sources from http://www.kernel.org/pub/linux/kernel/
    Unpack the sources wherever you want them:
    tar xvjf linux-2.x.x.x.tar.bz2
    Set the environment variable KERN_DIR:
    export KERN_DIR="/path/to/kernelsource"
    In the same terminal session try to reinstall VirtualBox.
    Good luck!

  6. randiroo76073 Says:

    Does this work in dapper? If so, do you change which VirtualBox you install?
    TIAFAI

  7. cameron.taljard Says:

    I’m having the exact same problem as Marius Scurtescu, if there is a solution the either a correct the install or removal of VirtualBox, please provide it.

    Tried snauth’s solution and a little hazy on how to set the KERN_DIR enviroment and the likes.

    Otherwise, thanks for the great article and seems like a great product when it’s working, but I’m in a bind now with the synaptic manager…

  8. admin Says:

    Does this work in dapper? If so, do you change which VirtualBox you install?
    TIAFAI

    Yes you need to download the dapper version of .deb package from virtualbox download lonk provided in the article.

  9. admin Says:

    Any one is having problem same as Marius here is the solution from virtualbox FAQ

    Debian packages: If the installation of the VirtualBox_*.deb package was not successful because the compilation of the kernel module fails, it might not be possible to remove the package nor to install other packages as the pre-remove (prerm) script of the package (which is executed prior to package removing or upgrading) aborts with an error “(Kernel module not found)…fail!”. In that case do the following:

    Edit /etc/init.d/virtualbox and change line 129 from ‘exit 1′ to ‘exit 0′

    Reinstall the virtualbox package by ‘dpkg -i ‘. An installation failure of this package is expected.

    Edit /var/lib/dpkg/info/virtualbox.postinst and change line 39 from ‘exit 1′ to ‘exit 0′

    Execute ‘dpkg --configure --pending

    The package should now be installed successfully. However, the kernel module is still not compiled. Before you will be able to execute VirtualBox you have to create a kernel module for your current kernel, as described in the User Manual(check the link provided at the end of the article)

  10. Marius Scurtescu Says:

    Just confirming that the instructions from the FAQ worked perfectly.

    Thanks a lot.

  11. Dalibor Says:

    Odlično. Obrisal sam vmware sa diska. Čestitam.

  12. shawn Says:

    jan 23rd 740pm

    Does this work with kubuntu 6.10 thank for your time

  13. admin Says:

    I hope it should work and i have not tested this on kubuntu 6.10

  14. Jeppo Says:

    Hallo, my VirtualBox installation works without errors in Edgy with kernel 2.6.17-10-generic, but when I call VirtualBox in the terminal, a window opens with a COM error message inside like “Failed to create the VirtualBox COM object” and in the window “Callee RC:0×80004004″
    what can I do?
    thanks

  15. domino Says:

    Driving me nuts! I can install Windows and all hardware is detected by the windows guest. When I try to install Server 6.0.6 or Server 6.10, neither guest boot the kernel. Does vbox have problems with booting smp kernels?

  16. Jeff Says:

    Installation on Edgy for me went fine. The only problem I had was once I created a virtual instance and tried to start it got a 1909 error that said it couldn’t find a driver. Had to add read write privledges to the /dev/vboxdrv with a

    sudo chmod a+rx vboxdrv

    and it works like a charm.

  17. Scott Carson Says:

    I’m another Windows user attempting to migrate to Linux/Ubuntu 6.10. Have VirtualBox running with my Windows XP host, but still struggling with the Linux Host setup/install.

    Can you please tell me how/where to get the additional apps that VirtualBox requires?

    I tried your instructions and when I ran the following:

    sudo apt-get install libxalan110 libxerces27

    The TERMINAL halted with a message that the libxalan110 could not be found.

    Thanks

    Scott
    scottcarson@austin.rr.com

  18. Kevin Snow Says:

    VirtualBox is great! Thanks for doing this write up. I just want to pass on a couple of tips that helped me get things going.

    First, during the initial install, the vboxdrv kernel module doesn’t load, so the installation fails with a
    scaring sounding message about not being able to complete the postisntall script. To resolve this, you can either just run the installation again, and it completes w/o any failure messages, or you can run

    sudo modprobe vboxdrv

    and that will get the driver loaded.

    I don’t know if others have run into this, but trying to install a new Windows guest OS from a physical CD/DVD drive was painfully slow. It’s much easy to copy the CD/DVD onto your system to a location like /tmp/winxp.iso and then point at it during the initial install with the “Devices” -> “Mount CD/DVD-ROM” -> “CD/DVD-ROM Image…” menu selection.

    A quick note for the last post from Scott, check to make sure that you have the “universe” repository enabled in /etc/apt/sources.list.

  19. hdk Says:

    i get this error what can i do

    VirtualBox kernel driver not accessible, permission problem.
    At ‘/home/vbox/vbox/src/VBox/VMM/VM.cpp’ (303) in int VMR3Create(void (*)(VM*, void*, int, const char*, unsigned int, const char*, const char*, char*), void*, int (*)(VM*, void*), void*, VM**).
    VBox status code: -1909 VERR_VM_DRIVER_NOT_ACCESSIBLE
    .

    Result Code:
    0×80004005
    Component:
    Console
    Interface:
    IConsole {1dea5c4b-0753-4193-b909-22330f64ec45}

  20. Phil Miesle Says:

    Scott Carson and others getting the error about libxalan110 (or other packages not being found):

    To install onto a clean Edgy installation I had to:

    1. sudo vi /etc/apt/sources.list

    and uncomment the ‘universe’ entries (as mentioned by Kevin Snow)

    2. sudo apt-get install linux-libc-dev libc6-dev libqt3-mt libxalan110 libxerces27

    3. sudo dpkg -i VirtualBox_1.3.6_Ubuntu_edgy_i386.deb

    4. Add your user the vxboxusers group in /etc/group (System->Administration->Users and Groups if you’re not sure)

    5. Log out and log back in (so your ‘new’ group is picked up).

    Thanks,
    :-Phil

  21. rb Says:

    if you are getting this error:

    VirtualBox kernel driver not accessible, permission problem.
    At ‘/home/vbox/vbox/src/VBox/VMM/VM.cpp’ (303) in int VMR3Create(void (*)(VM*, void*, int, const char*, unsigned int, const char*, const char*, char*), void*, int (*)(VM*, void*), void*, VM**).
    VBox status code: -1909 VERR_VM_DRIVER_NOT_ACCESSIBLE

    Then it is a permissions problem. either you are not root, or you are not in the vboxusers group, see the user manual for virtual box for more info.

    If you get an error about the console,
    it may be your X Server, starting VirtualBox over a VNC connection can be problematic.

  22. Simon Says:

    Worked for me, I have a XP pro / Ubuntu dual boot HP dv1000 (955 chipset) I installed virtualbox on Ubuntu (following the instructions EXACTLY) and it all worked fine.

    Then installed XP (pro) into virtualbox from the DVD drive and that worked too

    Now I just need to get it to set-up a shared file an I’ll be laughing…

  23. Simon Says:

    sorry, I should add it’s Ubuntu Edgy 2.6.17-11-generic

  24. montanamax Says:

    My VirtualBox installation worked without errors in Edgy with kernel 2.6.17-10-generic, and was actually running a virtual OS for a while. But now a few weeks later when I call VirtualBox a window opens with a COM error message inside like “Failed to create the VirtualBox COM object” and in the window “Callee RC:0×80004004″

    Help?

    Thanks,

  25. montanamax Says:

    Make that 2.6.17-11-generic - my bad!

    Thanks,

  26. John Says:

    Nice tutorial, I used it as the basis for a tutorial I made to install Vista in VirtualBox:

  27. x86 Virtualization Says:

    VirtualBox, Everything you need to know…

    VirtualBox is a simple easy to use virtualization tool. With support for most common Intel clients such as Windows XP, Vista (note issue about manually installing NIC drivers, Solaris and many versions of Linux. The windows interface is quick to load a…

  28. mojojojo Says:

    Hey nice howto..

    I have VirtualBox installed on my kubuntu edgy, I installed opensuse10.2 as guest and it seems to be running fine, I am still in exploration phase though.

    i am trying to share my host files on the guest, I executed the command that is in the VBox manual;
    VBoxManage sharedfolder add “VM name” -name “sharename” -hostpath “C:\test” -transient

    filling in the appropriate names and path relating tomy system;

    VBoxManage sharedfolder add “OpenSuse10.2″ -name “mulanga” -hostpath “/home/mojojojo/Desktop” -transient

    i am not exactly sure how to do the next step which is mounting from the guest shell because it doesn’t locate the file i had assigned.

    can you help in anyway?

    thanks

  29. Pedro Says:

    If you get a message saying “VirtualBox kernel driver not accessible, permission problem” … run usermod -G vboxusers -a …log out for the changes to take effect.

    From: http://www.virtualbox.org/wiki/User_FAQ

  30. bodhi.zazen Says:

    First, thank you once again Ubuntu-geek for this quality how-to.

    Second you can use “Open With -> GDebi” to install virtual box + dependencies from the gui (just a FYI for gui-centric individuals)

    And last, a word about documentation and “beyond the install” information :

    The VirtualBox documentation seems sketchy at times and is geared for rpm systems.

    I am trying to maintain some additional, Ubuntu specific documentation here :

    http://doc.gwos.org/index.php/VirtualBox

    Topics include Seamless Integration of Windows Applications, VBoxGuestAdditions, Networking, Enable USB devices, Sharing your hard drive, Running “headless”, Convert a VMWare appliance, and updating (Virtualbox and/or kernel).

    Please consider adding a link to the wiki to your how to !

    I am running Virtualbox on Feisty (+ Beryl) and have had no problems.

    Any input to the wiki is appreciated! You can PM me on the Ubuuntu forums if you have suggestions, items you would like to see documented in the wiki, or feedback.

  31. MKDon Says:

    I have VirtualBox running on Ubuntu Feisty but when try add a share it cannot find the VM and if I try
    root@xxxxx:/home/bob/.VirtualBox# VBoxManage showvminfo Winxp
    VirtualBox Command Line Management Interface Version 1.3.8
    (C) 2005-2007 InnoTek Systemberatung GmbH
    All rights reserved.

    [!] FAILED calling virtualBox->FindMachine (Bstr(argv[0]), machine.asOutParam()) at line 1436!
    [!] Primary RC = 0×80070057
    [!] Full error info present: true , basic error info present: true
    [!] Result Code = 0×80070057
    [!] Text = Could not find a registered machine named ‘Winxp’
    [!] Component = VirtualBox, Interface: IVirtualBox, {e1d95593-f579-4f47-b489-0b67181014e1}
    [!] Callee = IVirtualBox, {e1d95593-f579-4f47-b489-0b67181014e1}
    root@xxxxx:/home/bob/.VirtualBox#
    I get the above error.
    yet in the .VirtualBox/machines the VM is there.
    any ideas?

  32. andy_rightathome Says:

    Hi,
    Great how to. Worked like a charm. I installed VirtualBox using the .deb file for Feisty (KUbuntu 7.0.4) and it worked flawlessly. Have setup a Feisty guest on a Feisty host and it is working perfectly with the guest additions installed.

    A welcome pleasant experience after battling with Qemu on Feisty all day long.

    Had to re-install Qemu to get it to finally work(was immediately going to ‘Stopped’ after starting Qemu). And then it finally bombed during the Feisty installation as guest OS with a message that primary partition ‘/’ could not be mounted! What a PITA. qcow, qcow2, raw format no help. Tried Edgy, same problem. No help from Google searches.

    Same setup on Virtual Box worked flawlessly! Performance appears to be acceptable too with a virtual mem of 256MB running on a Pentium 3GHz processor with 1GB memory on host system running Feisty Fawn (KUbuntu 7.0.4 desktop version).

    -Andy

  33. steve Says:

    if u get:
    VirtualBox kernel driver not accessible

    run it as root

  34. Dimitri Mallis Says:

    i cant build form source on edgy 64bit…

    $ ./configure
    Checking for environment:

    Warning! Support for AMD64 host systems is work in progress.
    Don’t expect it to work or even to build at the moment.

    Determined linux.amd64, OK.
    Checking for kBuild: found, OK.
    Checking for gcc: found version 4.1.2, using precompiled objects for recompiler, OK.
    Checking for as86:
    ** as86 (variable AS86) not found!

    i guess i will just have to wait abit…

  35. Steven Says:

    Error cannot install ‘libxalan’

    how do I solve this problem?

  36. streppel Says:

    apt-get install bin86

  37. Marko Kettunen Says:

    Uhmm… Where’s that makefile for VirtualBox located at? Seems like I’m having some minor difficulties getting that KERN_DIR added, although I do know in which directory the source code is… Probably I’m just stupid or something. Maybe I should just cry out for my mom to help me.

  38. Tom Says:

    Your instructions worked great and Virtual Box opened right up. I am using Ubuntu Feisty 7.04 (32 bit). Virtual Box Version 1.4.0 for i386. However, I also received this error in the terminal at the same time.

    WARNING: You are not a member of the “vboxusers” group. Please add yourself
    to this group before starting VirtualBox.

    You will not be able to start VMs until this problem is fixed.
    Qt WARNING: X Error: BadDevice, invalid or uninitialized input device 166
    Major opcode: 146
    Minor opcode: 3
    Resource id: 0×0
    Qt WARNING: Failed to open device
    Qt WARNING: X Error: BadDevice, invalid or uninitialized input device 166
    Major opcode: 146
    Minor opcode: 3
    Resource id: 0×0
    Qt WARNING: Failed to open device

    How do I add myself as a member of the group? And when I do that, will those warning messages disappear?

  39. Tom Says:

    nevermind about adding myself as a user. I managed to do that, but the above warning messages are still there. Can someone give me an instruction on how to remove those warnings?

  40. Ian Johnston Says:

    I have successfully installed Virtualbox on two machines, both running Feisty. I used the repositories listed at Innotek and the installations went perfectly.

    On the other hand…

    On Machine 1, I have tried to install three guest OSes without success: OS/2 4.5 (crashes during install), Windows 98 (freezes during install) and - scrabbled around in box of operating systems - BeOS 4.5 (can’t access the CD it has just booted from and gives up during install)

    On Machine 2, a laptop, I have WIndows 98 installed as guest, but it is very slow, uses 50% CPU at all times, won’t run in anything other than 640*480*16 and crashes on restart if I try to save a snapshot - it has to be rebooted each time.

    So rather a mixed experience. Looks nice, installs easily, doesn’t actually, erm, work.

    Ian

  41. Mike Says:

    unable to get WinXp.iso to load correctly in Virtual Box. The install locks up every time.

    ANy Ideas?

    Thx

    Mike

  42. Scott Says:

    I’ve read all the manual, faqs, pointer, etc and I’m still having problems. I’ve installed Virtualbox, have the account permissions correct, and have created a VM. I don’t know how to load the OS into the VM or have the VM use a directory on a fat32 partition. So everytime that I ‘power up’, I get no bootable OS found. Can anyone point me to the directions on what to do next. Regards.

  43. admin Says:

    @hi scott

    first you need to create a new VM with the above procedure after taht you need to follow as normal machine procedure for example you want to boot from cd use f2 key to set the boot options at the time of starting your VM then start the installation

  44. Scott Says:

    Your input was definitely helpful. The problem was that, even though the OS cd was being recognized by the Linux, VB was only seeing the cdrom, not the burner. I am now able to select f12, select cdrom, and it accesses the lower cdrom with the OS cd.
    Thank you so much!

  45. Carl Lee Says:

    Qt WARNING: Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
    Segmentation fault (core dumped)

    Why the warning/error above happen? How to solve it?

    Thanks

  46. George Lupanow Says:

    The install looks like it works fine.
    I added myself to the vboxusers group and verified with grep.
    When I try to start VirtualBox, I get the following messages:
    *** stack smashing detected ***: /usr/lib/virtualbox/VirtualBox terminated
    Aborted (core dumped)

    What does this mean and how do I fix it?
    Thanks

  47. kj_synack Says:

    @MKDon
    You should run VBoxManage commands with as user “bob”, NOT root. That particular command looks for your “guest” in /home/.bob/

Leave a Reply

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