I tried to use VirtualBox on iMac to run a guest Ubuntu 11.04. Thus I can access a ext4 USB hard-disk.
I met some difficulty and here is some note about how I fixed them.
Does not recognize the USB device.
Workaround in short: Set the virtual machine to have 1 CPU.
Some details (Ref):
- Configure VirtualBox to have only one CPU
- Add a new usb filter so that Virtualbox grabs external hard disk before Apple OS X
- Boot the guest Ubuntu. Monitor the syslog file to find out the USB device name: tail -f /var/log/syslog
- Connect the USB disk to you iMac (In my case the device name was sdb2 from the log above)
- sudo mount /dev/sdb2 /mnt
When I configured the guest to have 4 CPUs, I got such errors in the syslog when I connect the USB disk:
But after I reconfigure the virtual box to only have one CPU, the problem was just gone.
Desktop resolution (Installing Guest Additions)
By default the resolution only went to as higher as 1024 x 768, and the Unity desktop environment does not work.
Solution in short: Install Guest additions, Enable 3D of the VirtualBox settings.
- Start the virtual machine.Select "Install Guest Addtions" from the "Devices" menu in the virtual machine's menu bar.
- In the guest Linux, a CD will mount and autorun. Follow the instructions.
You can also install the virtualbox-ose-guest-x11 package from the Ubuntu package manager but it's better to install the Guest Addition from the VirtualBox tool itself.
Use Shared Folders (ref)
- You can add shared folders and give each of them a name from the settings of the VirtualBox or from a folder icon at right bottom of the virtual machine window.
- in the guest Linux, use mount command to mount the folder: sudo mount -t vboxsf sharename /mnt