#Mounting Raspberry Pi Drive via Vagrant
Find instructions here Vagrant. Probably not a bad idea to run the getting started and make sure it works.
With your pi drive mounted (e.g. via a microsd reader) run VBoxManage list usbhost
. This will print a list of UDB devices available to VirtualBox. Look for one that matches your device, this will probably have a manufacturer name of "Generic". Once you find it, note the VendorId and ProductId.
Make a new directory and run vagrant init
. This will create a Vagrantfile
. Open this in a text editor and replace everything with this:
Vagrant.configure("2") do |config|
config.vm.box = 'precise64'
config.vm.box_url = 'http://files.vagrantup.com/precise64.box'
config.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id, '--usb', 'on']
vb.customize ['usbfilter', 'add', '0',
'--target', :id,
'--name', 'PiImage',
'--vendorid', '0x05e3',
'--productid', '0x0736']
end
end
Replace the vendorid and productid values with the ones you found in the last step.
Run vagrant up
to start the project.
Once the machine is up, run vagrant ssh
and you will ssh into the virtual machine. To mount the device I recommend using pmount. You can install it by running sudo apt-get install pmount
. Once pmount is installed you need to find where your USB drive is so you can mount it. Run sudo fdisk -l
to get a listing of all disks. Look for one that matches, it will probably look something like:
Disk /dev/sdb: 32.0 GB, 32010928128 bytes
64 heads, 32 sectors/track, 30528 cylinders, total 62521344 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0cf63fa8
Device Boot Start End Blocks Id System
/dev/sdb1 8192 131071 61440 c W95 FAT32 (LBA)
/dev/sdb2 131072 62521343 31195136 83 Linux
In this case the device I want is at /dev/sdb2
. Now mount the drive by running pmount /dev/sdb2
. This will mount the drive in /media
in this case it would be /media/sdb2
. From there you can cd into that directory and access the full filesystem.
Once you are done unmount the device using pumount /dev/sdb2
where "/dev/sdb2" is the name of your device.
If you want to copy files to and from the drive you can use the /vagrant
directory which is mapped to the directory your vagrant project was run from. Any files you add to that dir you can then find in /vagrant
and copy to and from as you usually would.