Making Ubuntu Server Work in VirtualBox
VirtualBox is open source virtualization software similar to VMware. I wanted to run a virtual Ubuntu LAMP server for testing, but I ran into a problem with VirtualBox.
Ubuntu Server has its own kernel which has PAE (physical address extension) support. This is not supported in VirtualBox and prevents the virtual Ubuntu from booting. Using Ubuntu’s recovery mode it is possible to install another kernel which will work in VirtualBox.
[update] Since version 1.6, VirtualBox now includes experimental support for PAE and Ubuntu’s server kernel. If you’ve updated to the latest version of VirtualBox then enabling PAE support for the virtual machine should allow you to run Ubuntu server without installing a new kernel.
After installing Ubuntu server in the virtual machine, boot off the CD again and
select the Rescue a broken system
option.
Answer the various language and keyboard questions when you are prompted. After
the installer detects your hardware it will ask you to select the root file
system from a list. For me, the root partition was the first one in the list.
Then select Execute a shell in [partition]
. Select continue
and the shell
will start.
Run these commands to download the package list, install a new kernel, and remove the non-working server kernel:
apt-get update
apt-get install linux-386
apt-get remove linux-server
Close the shell by typing exit and selecting Reboot the system
. Enjoy your
virtual server!
Archived Comments
Tom
clunknjunk,
It looks like that is a bug in Ubuntu:
https://bugs.launchpad.net/ubuntu/+source/rescue/+bug/60423
It works for me in Ubuntu 6.06 LTS, and for other versions there seems to be a workaround by pressing Alt+F2 to reboot.
Tom
clunknjunk
Hi Tom,
I tried to Alt+F2 at the menu screen but instead of rebooting it took me to a
console marked:
BusyBox v1.1.3 (Debian 1:1.1.3-3ubuntu3) Built-in shell (ash)
Enter ‘help’ for a list of built-in commands.
I managed to reboot the system by typing in ‘reboot’. But once again, when the system booted up it said that it had failed to unmount properly, check forced, errors, reboot again.
Quite an unusual bug…surprised that it hasn’t been fixed considering it has been known about for some time. Thanks for your help though!
Fabio Zendhi Nagao
Hum… Am I wrong or we are installing linux-server, installing linux-386, uninstalling linux-server?
arf
I’ve tried:
apt-get remove linux-server
apt-get install linux-386
apt-get install linux-server
then it works!
mrowan007
Worked great for me. Macbook Pro, Parallels 3.x
Emperorming
If your running the new ubuntu 7
you mite want to try
apt-get install linux-generic
there is no linux-386 no more
enjoy ^^
raytube
Using
apt-get install linux-generic
did NOT work for me.
FYI, this works for me for this error from ubuntu 7.10 on virtualbox:
apt-get update
apt-get remove linux-server
apt-get install linux-386
apt-get install linux-server
rodrigo
Hi.
Worked great for me.
Thank.
agouram
Thank you for the tip it worked very well for me.
Anonymous
I had the same problem in Ubuntu 8.04 LTS Server
raytube’s solution fixed it:
apt-get update
apt-get remove linux-server
apt-get install linux-386
apt-get install linux-server
Thanks guys!
Ghost_S
Thanks!!!It work!
jarko
I don’t know how long this has been in VirtualBox. But anyway when you go to the Ubuntu server VM’s settings, there is in the general settings>advanced(tab)>PAE/NX switch…
Anonymous
thank you :-)
Anonymous
Is there a way that you can get the updates on the main machine instead of
having to download them from the internet via apt-get update?
For some reason my virtual machine doesn’t seem to resolve names eventhough I
can ping the outside world.
So i’d like to get the files on to the machine that is running the virtual instance and get it from there to update the kernel. is that possible?
Many thanks for your help,
Jacob
Javier Rovegno
Works perfect!
Thank you.
MDunigan
I am trying to install an Ubuntu v6.06 LTS server to test upgrades to v8.04 LTS. Per the Update in the post, I went into VirtualBox 1.6.4 and turned on PAE/NX Under General->Advanced and the server booted right up with no changes. On to complete the updates.
marcthenarc
It worked great with 1.5.6. Thank you.
Bob Igo
This worked with VirtualBox OSE 1.5.6 and Ubuntu server 8.04, but not Ubuntu server 8.10. Perhaps the 386 kernel also requires PAE now?
Anonymous
thanks for the update! Once I found this post and enabled PAE, I was able to boot after installing Ubuntu Server 8.10.
Subhojit
Thanks a lot!! Worked great for me.
Anonymous
Excellent tip from jarko
( jarko said, in May 25th, 2008 at 12:51 am
I don’t know how long this has been in VirtualBox. But anyway when you go to the Ubuntu server VM’s settings, there is in the general settings>advanced(tab)>PAE/NX switch…)
I am running Ubuntu 8.04 LTS Server Edition on Virtual box (hosted by Ubuntu
Hardy Heron).
Using jarko’s tip made it work!
Thanks Jarko !
tobych
This solution worked for me, but I needed to choose the appropriate kernel when booting: pressed ESC to enter the GRUB boot menu and select the -generic kernel. I’ll try editing /boot/grub/menu.lst and make this the default kernel. I realised this after seeing the Trac page for a bug in the installer.
Axel
I just posted a solution on my blog for getting Ubuntu Server 9.10 to run on Virtual PC in Windows 7:
http://blog.axelfontaine.eu/2009/11/taming-beasts-getting-ubuntu-server-910.html
Credits go to this post for inspiration!
clunknjunk
This doesn’t work for me. It’s all going well until the final step when I try to select “reboot the system” and get a blue screen with “_pSLsys_getkey: EI0 error” plastered all over it. I have to then shut down the virtual machine and restart it…but it then has to undergo error fixing and doesn’t work properly.