virtualbox
Mount files from host OS into guest OS (shared folder)
Environment:
VirtualBox (3.2.4)
Host OS: Mac OS X (10.6)
Guest OS: Ubuntu (10.04) [Debian]
Click on "Devices" menu under VirtualBox
Click on "Shared Folders ..."
Click on <<Add Share>> icon
Provide "Folder Path" -- that is, the folder from the host OS to be shared with the guest OS
Give "Folder Name" -- that is, the name by which the shared folder should be exported to the guest
Mark the "Read-only", "Make permanent" flags according to your needs
Make sure your guest OS is incorporated (compiled) with the VBoxGuestAdditions provided by VBox
log into guest, find out your UID value (using id command in terminal)
sudo mount -t vboxsf -o uid=1000 share /mnt/guest-mount-point-for-share
Autostart guest with host
Environment:
VirtualBox (4.1.4)
Host OS: Mac OS X (10.6)
If you want your virtual machine to start/stop automatically along with your host OS, here are the steps.
Write a .plist file in /Library/LaunchDaemons directory. Name it appropriately, I have named it local.vtp.work.plist And change the values where necessary; e.g., home directory, user name.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.vtp.work.plist</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/VBoxHeadless</string>
<string>-startvm</string>
<string>work</string>
</array>
<key>KeepAlive</key>
<true/>
<key>UserName</key>
<string>panini</string>
<key>WorkingDirectory</key>
<string>/Users/panini/VirtualBox VMs/work</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Load the .plist using launchctl command: sudo launchctl load /Library/LaunchDaemons/local.vtp.work.plist
Check if the vm "work" is running: VBoxManage list runningvms
To temporarily stop the automatically running vm for VirtualBox upgrade: sudo launchctl remove local.vtp.work.plist
Upon upgrade, load the .plist using launchctl command as shown above.
Virtualbox cloning - network issue (ERROR: no such device)
Environment: (October 2011)
VirtualBox (4.1.4)
Host OS: Mac OS X (10.6)
Guest OS: Debian 6.0
The cloned vm may not have network. Because the VBoxManage clonevm process changes the MAC address of new vm. However, it does not change /etc/udev/rules.d/70-persistent-net.rules file in which the MAC address of source vm is hardcoded. So, in order to get the cloned vm have network access; comment out the rules in /etc/udev/rules.d/70-persistent-net.rules and reboot the cloned vm. The rules will be created again at boot with new MAC address.
Remote guest installation
Environment: (April 2013)
VirtualBox (4.2.10)
Host OS: Debian 7 (stable/wheezy)
Guest OS: Debian 7 (stable/wheezy)
Assign a new name to the VM: $VM='kaveri'
Create a HDD for this VM: $ VBoxManage createhd --filename $VM.vdi --size 32768
$ VBoxManage createvm --name $VM --ostype "Debian_64" --register
$ VBoxManage storagectl $VM --name "SATA Controller" --add sata --controller IntelAHCI
$ VBoxManage storageattach $VM --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium $VM.vdi
$ VBoxManage storagectl $VM --name "IDE Controller" --add ide
$ VBoxManage storageattach $VM --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium /path/to/debian.iso
$ VBoxManage modifyvm $VM --ioapic on
$ VBoxManage modifyvm $VM --boot1 dvd --boot2 disk --boot3 none --boot4 none
$ VBoxManage modifyvm $VM --memory 1024 --vram 128
$ VBoxManage modifyvm $VM --nic1 bridged --bridgeadapter1 e1000g0
VBoxManage extpack install package-file