2

I used a set of instructions to create a bootable USB drive for ChromeOS. I want to install ChromeOS in VirtualBox. This is apparently impossible to do from a USB drive. I tried mounting the 9GB .img file as a floppy controller, but it errors out.

The only thing I can think to do, in order to get this installed in VirtualBox, is to write the .img to a USB, then try to copy the USB to an ISO and try to boot as a live ISO, as that is what would normally happen on a hardware install. (Reboot PC, boot from USB, ChromeOS boots, run a few commands and it's installed)

I'm making an attempt with ddrescue, but I don't imagine that'll work.

How can I make a bootable ISO to accomplish this task, or what other solution can you recommend to reach the end goal by any means?

2

Writing a bootable ISO image to USB and having it boot only works if the ISO image is specially prepared to be bootable in such a situation, using isohybrid or similar tool. That tool embeds another bootloader in the very beginning of the ISO image that is only used when the ISO image is written to USB.

The opposite, turning a bootable USB image to a bootable ISO would normally require installing a different, ISO9660-compatible bootloader.

However, you could fairly simply copy your .img into .vdi.

From your second link, I found this procedure.

A slight variation of it should be good for your purposes:

1.) First, create a .vdi file of the necessary size. The contents are unimportant, as they will be overwritten in the next step.

2.) Make it accessible as a block device:

modprobe nbd
qemu-nbd -c /dev/nbd0 <your vdi file>.vdi

3.) Now write your ChromeOS USB .img directly to the .vdi file:

dd if=/some/where/your-chromeos.img of=/dev/nbd0

This will automatically copy the partition table and all the partitions within the .img file to the .vdi file.

4.) Once done, disconnect the .vdi file from the device:

qemu-nbd -d /dev/nbd0

Now you'll have a .vdi file you can use in lieu of an USB stick in the VirtualBox world. Configure it as an extra virtual disk for the new VM and boot from it.

Disclaimer: I don't have ChromeOS so I cannot test this procedure, but it should work in theory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.