¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

HamPC with VirtualBox


Alex Niu
 

Hi Dave,

I¡¯m trying to install HamPC in VirtualBox and it doesn¡¯t recognize the .img. I can not convert the image to .iso either. Any thoughts on what is missed in my process? Thank you.

73
Alex, VE9WS


 

Alex,

Try this:?

HTH and 73,

On Sun, Nov 13, 2022 at 11:37 AM Alex Niu <alex.ve9ws@...> wrote:
Hi Dave,

I¡¯m trying to install HamPC in VirtualBox and it doesn¡¯t recognize the .img. I can not convert the image to .iso either. Any thoughts on what is missed in my process? Thank you.

73
Alex, VE9WS


--
-- Dave,?? ? ? ? ? ? ? ? ? ? ? ?Technical Specialist,??--
--?? Lifetime Member:?////?--
--??--


Alex Niu
 

Hi Dave,

Thank you for the quick reply. I was able to convert the img to vdi and attach to VirtualBox. But it says ¡°No bootable medium found! Please insert a bootable medium and reboot.¡± What else can I try?

Thanks, 73
Alex, VE9WS


 

Alex,

What is the name of the image you converted?

On Sun, Nov 13, 2022 at 2:58 PM Alex Niu <alex.ve9ws@...> wrote:
Hi Dave,

Thank you for the quick reply. I was able to convert the img to vdi and attach to VirtualBox. But it says ¡°No bootable medium found! Please insert a bootable medium and reboot.¡± What else can I try?

Thanks, 73
Alex, VE9WS


--
-- Dave,?? ? ? ? ? ? ? ? ? ? ? ?Technical Specialist,??--
--?? Lifetime Member:?////?--
--??--


Alex Niu
 

HamPC_v3.01b1.img


 

What version of VirtualBox are you using?


On Sun, Nov 13, 2022 at 3:00 PM Alex Niu <alex.ve9ws@...> wrote:
HamPC_v3.01b1.img


--
-- Dave,?? ? ? ? ? ? ? ? ? ? ? ?Technical Specialist,??--
--?? Lifetime Member:?////?--
--??--


Alex, VE9WS
 
Edited

Version 7.0.0 r153978 (Qt5.15.2) on macOS host. I have multiple Linux VMs in this box.

Downloading the latest 7.0.2 release to see if it makes a difference.

73
Alex, VE9WS


Alex, VE9WS
 

Upgraded to Version 7.0.2 r154219 (Qt5.15.2) and did not make a difference.

--
73
Alex, VE9WS


 

Under Settings -> System -> Extended Features, Is "Enable EFI" checked?

image.png


On Sun, Nov 13, 2022 at 3:24 PM Alex, VE9WS <alex.ve9ws@...> wrote:

Version 7.0.0 r153978 (Qt5.15.2) on Mac host


--
-- Dave,?? ? ? ? ? ? ? ? ? ? ? ?Technical Specialist,??--
--?? Lifetime Member:?////?--
--??--


Alex, VE9WS
 

With Enable EFI checked, it booted to Grub and then displayed this


dropped to BusyBox shell

--
73
Alex, VE9WS


 

I retraced your steps and it seems converted image to VDI format is somehow truncated by a couple of kB which breaks GPT partition table. To fix the issue please follow tips in??and add 1GB (or more if you'd like) to the disk size (I clicked via vbox gui and it worked). Then the machine booted normally to me.

Hope that helps.


Alex, VE9WS
 

Thanks Pawel,

I converted img to vdi fresh, added space to the vdi. Yet still it dropped to busybox shell. Can't figure out how to get it to boot.

--
73
Alex, VE9WS


 

The same error as before or something different? Can you please paste the screen with error??


 

Hi!

I've made a quick screen recording on how to fix the boot issue. I was using qemu-img to convert from "img" to "vdi" but if you used the VBoxManage command then this may help you fix the problem.


 

Pawel,

Thanks for posting such an informative video. In fact, how can I encourage you to join the HamPi / HamPC / HamIQ development team? You would be a welcome addition...

Question: am I doing something wrong when I'm creating the image? Am I making it too small accidentally, or is this just a required step to get the image to run on a VM?

Please advise, and 73,

On Wed, Nov 16, 2022 at 12:25 PM Pawel J via <laczliwosc-program.0l=[email protected]> wrote:
Hi!

I've made a quick screen recording on how to fix the boot issue. I was using qemu-img to convert from "img" to "vdi" but if you used the VBoxManage command then this may help you fix the problem.


--
-- Dave,?? ? ? ? ? ? ? ? ? ? ? ?Technical Specialist,??--
--?? Lifetime Member:?////?--
--??--


 

Hi Dave,

Thanks for the invitation. I'll be more than happy to join but I don't know how much time I can commit at this moment.

As for the image creation, I don't know what's your exact process but it seems the image is truncated by a few sectors (at least it seems like it). I tested the raw image on VBox, which you can do using the following command:
VBoxManage internalcommands createrawvmdk -filename hampc.vmdk -rawdisk /path/to/HamPC_v3.0.1b1.img

This creates a VMDK file which you can use in VirtualBox. Unfortunately it also won't boot.
Extending the raw .img file by 1 MB with?dd if=/dev/zero bs=1m count=1 >> HamPC_v3.0.1b1.img and recreating the vmdk (you have to recreate because of the file size change) also doesn't make it boot which suggests that one of the GPT records is corrupted. Probably the backup one at the end of the disk image. The testdisk tool can fix it but it needs the space to write the second record, hence the 1MB added to the image (without it the Linux partition - the second one on disk - is still "invisible" and gdisk tool complains about overlapping it and GPT table - at the end of the disk I guess).

Can you share how you create the .img file exactly? Are you using some kind of virtual machine?

Thanks!
PJ


 

Pawel,

I've sensed for a while now that there was some sort of "truncation" issue, but haven't been able to narrow it down...

The process for generating the image is a manual, then automated, then manual again. Here's the high level:

Insert new good SSD

Using BalenaEtcher, flash base image

Run Ansible (automated)

shutdown -h now

Insert SSD into Linux box.

sudo gparted

Unmount /dev/sdX1
Unmount /dev/sdX2

Resize /dev/sdX2 (Linux partition) to a "small size", around 16GB, versus the 128GB HamPi/HamPC is created on.

# Improve compressibility of image by zeroing out free blocks
sudo zerofree -v /dev/sdX2

# This is where I get the size of the drive
sudo fdisk -l /dev/sdX

pi@hampi:~ $ sudo fdisk -l /dev/sda
Disk /dev/sda: 111.79 GiB, 120034123776 bytes, 234441648 sectors
Disk model: Tech ? ? ? ? ? ?
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x556578a4

Device ? ? Boot ?Start ? ? ? End ? Sectors ? Size Id Type
/dev/sda1 ? ? ? ? 8192 ? ?532479 ? ?524288 ? 256M ?c W95 FAT32 (LBA)
/dev/sda2 ? ? ? 532480 234441647 233909168 111.5G 83 Linux

<end_block> = /dev/sdX End Block

Example: 234441647 (If I were using 128GB drive)

sudo dd if=/dev/sda bs=512 status=progress count=<end_block> | pxz -v -9 - > HamPi_FileName.img.xz

What am I missing here? I mean, for simplicity, I suppose I could do this instead (and maybe it would fix the truncation issue)

sudo dd if=/dev/sda status=progress?| pxz -v -9 - > HamPi_FileName.img.xz

Thoughts?

73,

On Wed, Nov 16, 2022 at 3:19 PM Pawel J via <laczliwosc-program.0l=[email protected]> wrote:
Hi Dave,

Thanks for the invitation. I'll be more than happy to join but I don't know how much time I can commit at this moment.

As for the image creation, I don't know what's your exact process but it seems the image is truncated by a few sectors (at least it seems like it). I tested the raw image on VBox, which you can do using the following command:
VBoxManage internalcommands createrawvmdk -filename hampc.vmdk -rawdisk /path/to/HamPC_v3.0.1b1.img

This creates a VMDK file which you can use in VirtualBox. Unfortunately it also won't boot.
Extending the raw .img file by 1 MB with?dd if=/dev/zero bs=1m count=1 >> HamPC_v3.0.1b1.img and recreating the vmdk (you have to recreate because of the file size change) also doesn't make it boot which suggests that one of the GPT records is corrupted. Probably the backup one at the end of the disk image. The testdisk tool can fix it but it needs the space to write the second record, hence the 1MB added to the image (without it the Linux partition - the second one on disk - is still "invisible" and gdisk tool complains about overlapping it and GPT table - at the end of the disk I guess).

Can you share how you create the .img file exactly? Are you using some kind of virtual machine?

Thanks!
PJ


--
-- Dave,?? ? ? ? ? ? ? ? ? ? ? ?Technical Specialist,??--
--?? Lifetime Member:?////?--
--??--


 

Hi!

I'd seem that you dd'ing until the end of sdX2 and not the whole disk may be the issue here. As far as I know the backup GPT partition table is in the last sector of the DISK and you may be loosing it. You can try your proposed approach with the whole disk dump and it may fix the issue here.

One quick question. Why aren't you using a virtual machine for the whole process of creating the disk image? It would speed things up as for example you could create a VMDK of even raw disk image of 32GB in size and run the whole bunch Ansible?scripts on it and later just distribute the vm disk image without the whole workload od dd'ind the disk.

I'm glad you were able to narrow the problem down to specific steps. In case I can help on something just let me know and we can setup another topic or you can contact me directly.

Best regards!
PJ


 

I think that's the mistaken assumption I made -- that the end of the partition was the end of the disk... Sheesh, how am I supposed to deal with this? I make the image on a 128GB SSD and can't go distributing an image that's 128GB large... Maybe I need to go find a 16GB SSD (if such a thing still exists)?


On Wed, Nov 16, 2022 at 4:43 PM Pawel J via <laczliwosc-program.0l=[email protected]> wrote:
Hi!

I'd seem that you dd'ing until the end of sdX2 and not the whole disk may be the issue here. As far as I know the backup GPT partition table is in the last sector of the DISK and you may be loosing it. You can try your proposed approach with the whole disk dump and it may fix the issue here.

One quick question. Why aren't you using a virtual machine for the whole process of creating the disk image? It would speed things up as for example you could create a VMDK of even raw disk image of 32GB in size and run the whole bunch Ansible?scripts on it and later just distribute the vm disk image without the whole workload od dd'ind the disk.

I'm glad you were able to narrow the problem down to specific steps. In case I can help on something just let me know and we can setup another topic or you can contact me directly.

Best regards!
PJ


--
-- Dave,?? ? ? ? ? ? ? ? ? ? ? ?Technical Specialist,??--
--?? Lifetime Member:?////?--
--??--


 

Why not use a VM as in my suggestion? Any reasons against it?