2

Good evening,

I installed ArchLinux on a USB stick, and I would like to boot it in qemu. Unfortunately, most examples I found boot an image (iso..).

The stick is definitely bootable as if I restart my computer, it shows a grub that can successfully start ArchLinux.

I have tried things such as

sudo qemu-system-x86_64 -usb -usbdevice disk:/media/louis/FlyinBaboon/boot/initramfs-linux.img -boot menu=on

only to get boot errors.

What is the correct way to start qemu by giving it a path to a linux root? (/media/louis/FlyingBaboon corresponding to my USB stick's root)

2 Answers 2

3

What kind of errors do you get?

Ex:

user@marconi ~ $ sudo qemu-system-x86_64 -usb -usbdevice disk:/mnt/usbdrive
qemu-system-x86_64: -usbdevice disk:/mnt/usbdrive: could not open disk image /mnt/usbdrive: Is a directory
qemu: could not add USB device 'disk:/mnt/usbdrive'

If you see something similar, the problem is that you are providing a filesystem path, but 'qemu' wants a reference to a block device.

Here is an example. I have a USB drive attached to my system. The block device is /dev/sdb, and the device is mounted at '/mnt/usbdrive' in the filesystem. You can see the relationship by looking at the system mount table:

user@marconi ~ $ cat /proc/mounts |grep sdb
/dev/sdb /mnt/usbdrive vfat rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0

If you give qemu the block device name, instead of a path in the filesystem, it should boot as you desire. For my example, the correct invocation would be:

user@marconi ~ $ sudo qemu-system-x86_64 -usb -usbdevice disk:/dev/sdb
1
  • Thanks, I was trying to boot on the mount point instead of /dev/sdb Apr 7, 2014 at 8:32
2

I have image of Fedora-netinstall on my USB drive, and I tried this two, and both works fine for me:

$ sudo qemu-system-x86_64 -cdrom /dev/sdb
$ sudo qemu-system-x86_64 -hda /dev/sdb

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .