[Solved] P2V of a Linux system

Discussions about using Linux guests in VirtualBox.
Post Reply
Just Intonation
Posts: 3
Joined: 18. Oct 2021, 09:54

[Solved] P2V of a Linux system

Post by Just Intonation »

I have been messing about with a friend's HP Stream that is running a Debian Linux (not sure exactly what version ATM but it probably doesn't matter). I want to install a different Linux distribution on it but before I do so I thought I'd P2V it so we can go back and run it up on VirtualBox if we ever need to. These systems don't have a hard drive, just a 32GB MMC memory module. I booted off a live Linux USB (Ubuntu 21.04 Hirsute Hippo) so that the MMC would not be mounted and did a:

Code: Select all

sudo fdisk -l
which shows the disk as /dev/mmcblk0 31268536320 bytes long with a GPT.

It also lists three partitions: a 25GB Linux filesystem, a 4.1GB Linux swap partition and some sort of 65MB vestigial Windows recovery partition. I put the whole lot on an external drive with:

Code: Select all

sudo dd if=/dev/mmcblk0 of=/media/ubuntu/76F22501F224C769/skipper/mmcblk0.img bs=4096 conv=sync,noerror status=progress
This showed 31268536320 bytes transferred as expected.

I took the external drive to another Ubuntu 21.04 Hirsute Hippo system with VirtualBox installed and ran:

Code: Select all

vboxmanage convertfromraw mmcblk0.img skipper.vdi
in the appropriate folder and the skipper.vdi file was created without complaint. I created a new Ubuntu VM in VirtualBox, attached the vdi and booted. I get the "Press F12 to select boot device." which times out and then complains "FATAL: No bootable medium found! System halted."

I tried messing around with the F12 menu: same result. I messed around with the VirtualBox System | Motherboard | Boot Order: same result.

I'm clearly making some sort of obvious basic error but I'm really not sure what it is - can anyone point out where my thinking is faulty?

Cheers!
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: P2V of a Linux system

Post by mpack »

Just Intonation wrote:[it] then complains "FATAL: No bootable medium found! System halted."
Did you enable EFI in the VM settings? It can't boot from a GPT drive without that.

p.s. The fact that "convertfromraw" gave no error is not meaningful. You could give it an Excel recipe for Mac and cheese and it would still happily wrap a VDI header around it. It's wrapping a raw image, so no headers to check and no way to verify the contents unless it gets a read error. Put another way: VirtualBox doesn't know anything about guest filesystems and partition maps, so it will accept anything that could be stored on a disk sector, which is anything.
Just Intonation
Posts: 3
Joined: 18. Oct 2021, 09:54

Re: P2V of a Linux system

Post by Just Intonation »

Thankyou @mpack - that makes complete sense.

When I set the VM for an EFI boot I get a shell that shows a FS0, BLK0, BLK1, BLK2 and BLK3. Navigating the FS0 I see an empty EFI/Boot and a EFI/Debian with some sort of grub.cfg file, a BOOTX64.CSV and four .efi files, so I think I'm in the right place and it looks like the disk image may have come across intact.

I will start working through the manual and try to understand how I boot the appropriate GPT entry from this point. Not sure why the EFI default selection didn't come across from the HP Stream but that might become clearer as I move through the task.

Also, thank you for explaining the VDI container - I don't do enough work with VMs to be familiar with characteristics of the various formats so its really helpful to understand this sort of detail.

Cheers!
Last edited by Just Intonation on 18. Oct 2021, 13:44, edited 1 time in total.
Just Intonation
Posts: 3
Joined: 18. Oct 2021, 09:54

Re: P2V of a Linux system

Post by Just Intonation »

All sorted - I added a startup.nsh file in FS0: with the line "\EFI\Debian\grubx64.efi" and now everything works smoothly.

Thanks for setting me on the path @mpack - I can see there's a whole other corner of the computing universe for me to master now!

Cheers!
Last edited by Just Intonation on 18. Oct 2021, 13:43, edited 1 time in total.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: P2V of a Linux system

Post by mpack »

Well done. I'll mark the topic solved.
Post Reply