|
@@ -0,0 +1,43 @@
|
|
1
|
+title: Blog
|
|
2
|
+post: Booting a USB Stick in VirtualBox with a Mac OS X Host
|
|
3
|
+date: 2013-12-30
|
|
4
|
+comments: true
|
|
5
|
+---
|
|
6
|
+
|
|
7
|
+## {{ page["post"] }}
|
|
8
|
+<!--%
|
|
9
|
+from datetime import datetime
|
|
10
|
+date = datetime.strptime(page["date"], "%Y-%m-%d").strftime("%B %d, %Y")
|
|
11
|
+print "*Posted at %s.*" % date
|
|
12
|
+%-->
|
|
13
|
+
|
|
14
|
+You can't just boot from a USB Stick with VirtualBox because it's BIOS does not support USB.
|
|
15
|
+However, you can still get it to boot from USB.
|
|
16
|
+But first, you have to convince OS X not to remount your USB Stick everytime it's `/dev/diskX` file is accessed.
|
|
17
|
+
|
|
18
|
+To do this, you need to know the Label of your USB drive (with spaces escaped with `\`) and it's filesystem type (fat32 in this case).
|
|
19
|
+
|
|
20
|
+Create the `/etc/fstab` file, if it doesn't exist already, and mark your stick as `noauto`:
|
|
21
|
+
|
|
22
|
+<pre class="sh_sh">
|
|
23
|
+sudo touch /etc/fstab
|
|
24
|
+sudo nano /etc/fstab
|
|
25
|
+LABEL=yourUSBstick none fat32 rw,noauto
|
|
26
|
+</pre>
|
|
27
|
+
|
|
28
|
+Then create a VirtualBox Disk Image, pointing to the block device file of your USB stick. Use diskutil to find out the device file name.
|
|
29
|
+
|
|
30
|
+<pre class="sh_sh">
|
|
31
|
+diskutil list
|
|
32
|
+sudo VBoxManage internalcommands createrawvmdk -filename rawUsbStick.vmdk -rawdisk /dev/diskX
|
|
33
|
+</pre>
|
|
34
|
+
|
|
35
|
+Now, run VirtualBox as root
|
|
36
|
+
|
|
37
|
+<pre class="sh_sh">
|
|
38
|
+sudo /Applications/VirtualBox.app/Contents/MacOS/VirtualBox
|
|
39
|
+</pre>
|
|
40
|
+
|
|
41
|
+Create a new Virtual Machine, using the .vmdk file created before as virtual hard disk drive. Boot it, and...
|
|
42
|
+
|
|
43
|
+Done! :)
|