Skip to content

Instantly share code, notes, and snippets.

@techniq
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techniq/fdfaebd49b208ebbaa6e to your computer and use it in GitHub Desktop.
Save techniq/fdfaebd49b208ebbaa6e to your computer and use it in GitHub Desktop.
Virtualbox tips
function vagrantId() {
    cat .vagrant/machines/default/virtualbox/id
}

Current interface config

VBoxManage showvminfo `vagrantId` | grep NIC

VBoxManage showvminfo `vagrantId` --machinereadable | grep bridgeadapter

Change interface config

VBoxManage controlvm `vagrantId` nic2 bridged en3

Refresh DHCP address

vagrant ssh

sudo dhclient -r -v eth1

sudo dhclient -v eth1

or

sudo ifdown eth1; sudo ifup eth1

Find the UUID of the VM you wish to detach the USB device from using

VBoxManage list runningvms
"ubuntu_trusty64_default_1407212569854_16240" {8414f65e-f644-49b3-ac93-ed19229e7f30}

Find the UUID of the USB device to detach using

VBoxManage list usbhost
...
UUID:               7834b53b-4f4b-4fd0-b557-d5328c0e5bf0
VendorId:           0x0bda (0BDA)
ProductId:          0x0307 (0307)
Revision:           1.37 (0137)
Port:               3
USB version/speed:  0/2
Manufacturer:       Realtek
Product:            USB3.0 Card Reader
SerialNumber:       201006010301
Address:            p=0x0307;v=0x0bda;s=0x0000601acc96b472;l=0xfa130000
Current State:      Captured

Detact the USB device from the VM

VBoxManage controlvm ${VM_UUID} usbdetach ${USB_UUID}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment