fatal: could not read from the boot medium

Discussions related to using VirtualBox on Linux hosts.
Post Reply
neuronetv
Posts: 81
Joined: 25. Aug 2014, 17:23

fatal: could not read from the boot medium

Post by neuronetv »

I'm running virtualbox 5.1 on a centos 7 server host machine (command line only) and I'm trying to convert a(nother) physical machine (running freepbx13) into a virtualbox guest machine. I took the hard drive out of the physical freepbx13 machine and I have it mounted in the centos 7 machine as a second drive (/dev/sdb). It's working fine and is fully accessible by the centos 7 host system.

I ran the following commands to create the vm:

Code: Select all

VBoxManage createvm --name "freepbx13" --register
VBoxManage modifyvm "freepbx13" --nic1 bridged --bridgeadapter1 enp6s4f0
vboxmanage modifyvm freepbx13 --usb on
VBoxManage storagectl "freepbx13" --name "IDE Controller" --add ide
VBoxManage modifyvm "freepbx13" --vrde on
VBoxManage modifyvm "freepbx13" --vrdeport 3390
VBoxManage internalcommands createrawvmdk -filename /root/VirtualBox\ VMs/freepbx13/freepbx13.vmdk -rawdisk /dev/sdb
and then started the vm. The guest appears to start up ok but in the guest console I get "fatal: could not read from the boot medium". After searching on google I tried

Code: Select all

# chown /dev/disk0*     (but I got)...
chown: missing operand after ‘/dev/disk0*’
I also tried:

Code: Select all

# chown /dev/sdb*
chown: invalid user: ‘/dev/sdb’
I deleted the vm and recreated it using just

Code: Select all

VBoxManage createvm --name "freepbx13" --register
VBoxManage modifyvm "freepbx13" --vrde on
VBoxManage modifyvm "freepbx13" --vrdeport 3390
VBoxManage internalcommands createrawvmdk -filename /root/VirtualBox\ VMs/freepbx13/freepbx13.vmdk -rawdisk /dev/sdb
but that didn't work either, I still get the 'Fatal:' error in the guest console. Can anyone point out what's wrong? thanks for any help.
JEBjames
Posts: 58
Joined: 26. Jan 2017, 18:27
Primary OS: MS Windows other
VBox Version: OSE other
Guest OSses: Centos, Ubuntu, Debian, Various Windows
Contact:

Re: fatal: could not read from the boot medium

Post by JEBjames »

Just a guess.

Is /dev/sdb still mounted on the *host* computer? If yes, try unmounting it first.

If still doesn't work, boot a linux iso in the guest and see if you can see the hd from inside the guest.

When I do physical to virtual conversions I don't use raw disks. I use a disk cloning tool (e.g. Clonezilla) to make a disk image of the target disk to a network share. Then I create a VM with a slightly larger hard drive than the original disk. I add an .iso of my disk cloning tool (e.g. clonezilla) into the CD of the virtual machine. Then I boot from this iso in the VM and restore the disk image from the network share into the vm. Then I shut down the guest and make a file copy of all the VM files.

Sometimes to get things going on virtual hard ware you need to re-run grub or inject hard drive controller drivers into the vm.

Not using raw disks means the original disk can safely stay offline. Far away from my ability to "try one more thing" until it breaks. :)

Just my two cents.
neuronetv
Posts: 81
Joined: 25. Aug 2014, 17:23

Re: fatal: could not read from the boot medium

Post by neuronetv »

thanks for your response JEBjames and sorry for my delayed reply. I gave up on rawdisk and I had success with clonezilla as you described. It was a battle but I got there in the end.
Post Reply