Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 316261 - grub fails to load when installing Gentoo on virtualbox
Summary: grub fails to load when installing Gentoo on virtualbox
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Patrick Lauer
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-20 01:10 UTC by Gabriel Prado de Moraes
Modified: 2010-07-01 18:44 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Prado de Moraes 2010-04-20 01:10:12 UTC
I run Gentoo and wanted to install Gentoo as guest on virtualbox. So both host and guest OSes are Gentoo.

I installed this Virtualbox:
http://download.virtualbox.org/virtualbox/3.1.6/VirtualBox-3.1.6-59338-Linux_x86.run
because the portage virtualbox was masked.

I downloaded the minimal Gentoo install:
install-x86-minimal-20100216.iso
and followed the Gentoo handbook to install Gentoo as virtualbox guest.

I created the partitions, formated, unpacked the stage 3 tarball, installed portage, chrooted, compiled the kernel and finally installed Grub.

I installed Grub manually:
grub> root (hd0,0)    (Specify where your /boot partition resides)
grub> setup (hd0)     (Install GRUB in the MBR)
grub> quit            (Exit the GRUB shell)


Everything was fine. Its not the first time I 've done this. 

It's time to reboot and I get
FATAL: Could not read from the boot medium! System halted.

Then I download a floopy iso to start Grub from the virtual floppy and make it boot my partition. It didn't work. The Grub autocomplete doesn't let me choose "root (hd0,0)". I can only choose "root (fd2)". Something tells me Virtualbox is not findind the virtual hard-disk. If I boot with the Gentto minimal install CD, I can mount the virtual-hd partitions.

Just to be shure, I installed ubuntu-9.10 on virtualbox. It works just fine. 

I did a lot of Googling. This guy here (http://blog.nixternal.com/2008.02.29/virtualbox-and-grub-issue/) says the problem is when you set the disk as dynamic (as opposed to static size). I don't belive this because Ubuntu worked with dymanic size.

This other guy (http://forums.gentoo.org/viewtopic-t-814623-start-0.html) says 
"the solution is to install from a Ubuntu CD, not the Gentoo minimal CD, so that you can use gparted to initialise the virtualbox image and not cfdisk. Both tools mark the partition as bootable, but apparently only gparted sets up the boot process/mbr correctly."

Is this correct? Gentoo fails to initialize the MBR correctly in virtualbox when Ubuntu succeeds?

I spent three days at this. Can anyone tell me whats is wrong?
Thanks a lot!



Reproducible: Always

Steps to Reproduce:
1. Install Gentoo on Virtualbox
2. reboot

Actual Results:  
FATAL: Could not read from the boot medium! System halted.

Expected Results:  
show Grub menu
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2010-05-19 17:29:24 UTC
Please try with a version from portage before you file a bug here.

Also please read 

  http://www.gentoo.org/doc/en/bugzilla-howto.xml#doc_chap6

because you assigned this bug to a totally wrong Product/Component group...
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2010-05-19 17:30:00 UTC
reopening for assigning this bug correctly...
Comment 3 Lubos Katrinec 2010-06-24 20:48:48 UTC
I've got exactly the same issue.
Is there any progress on this?
Comment 4 Gabriel Prado de Moraes 2010-06-26 14:27:41 UTC
(In reply to comment #3)
> I've got exactly the same issue.
> Is there any progress on this?
> 

Lubos, I stopped trying when I filed this bug report. I haven´t had any news from them. If you find a solution please post the answer here. I'm still interested.
thanks!
Comment 5 Lubos Katrinec 2010-07-01 18:44:49 UTC
> Lubos, I stopped trying when I filed this bug report. I haven´t had any news
> from them. If you find a solution please post the answer here. I'm still
> interested.
> thanks!
> 

Hi,

I solved it with parted tool (included in minimal live image).
Commands I used:

parted /dev/sda
(parted) mktable msdos               
(parted) mkpart primary 1 100M  
(parted) set 1 boot on
(parted) print               

Next I continued with creating other partition and installing stage3, portage, grub, ...
This time grub loaded as expected.