Test booting from your USB device without rebooting your Linux PC
Par theYinYeti le dimanche 22 septembre 2013, 09:27 - Lien permanent
First plug your USB device. These days, chances are it will get mounted automatically. Unmount it; but don’t eject it (use the
umount command as root in a terminal window, if need be).
In a terminal window, ensure you have read and write access to the device. For example, let’s assume my device is
[me@home ~]$ ls -l /dev/sdb*
brw-rw---- 1 root disk 8, 16 21 sept. 17:10 /dev/sdb
brw-rw---- 1 root disk 8, 17 21 sept. 16:50 /dev/sdb1
In this example, the device is writeable by group disk. So I’ll just make sure I am part of this group, logout, and log back in. If your situation is not this simple, or you don’t want to change your groups, you may, as a quick hack, run this command:
[root@home ~]$ chmod 666 /dev/sdb*
The above command will simply make the device writeable by anyone, including you ;) This change shouldn’t be permanent; it should automatically get reversed on next reboot.
OK, so now you have full control of the device. Next comes the step where you create a description of the device, for VirtualBox to use. Here’s the command:
[yves@home ~]$ VBoxManage internalcommands createrawvmdk -filename ~me/VirtualBox\ VMs/FLASH.vmdk -rawdisk /dev/sdb
Of course, change
me with your real user name. Don’t forget the tilde: “
~me” means “
home directory of ‘me’”.
Finally, in VirtualBox, create a machine with the features you need. Choose the newly created
FLASH.vmdk disk as the main disk to boot from. Start the machine. Done.