Showing posts with label Virtual Box. Show all posts
Showing posts with label Virtual Box. Show all posts

Saturday, January 11, 2014

VBoxManage (The VirtualBox CLI)

VBoxManage (The VirtualBox CLI)

This is a online reference of the output of VBoxManage without options.
Sun VirtualBox Command Line Management Interface Version 3.1.4
(C) 2005-2010 Sun Microsystems, Inc.
All rights reserved.

Usage:

VBoxManage [-v|--version]

VBoxManage [-v|--version]    print version number and exit
VBoxManage [-q|--nologo] ... suppress the logo

VBoxManage list

VBoxManage list [--long|-l] vms|runningvms|ostypes|hostdvds|hostfloppies|
                            bridgedifs|hostonlyifs|dhcpservers|hostinfo|
                            hostcpuids|hddbackends|hdds|dvds|floppies|
                            usbhost|usbfilters|systemproperties

VBoxManage showvminfo

VBoxManage showvminfo       <uuid>|<name> [--details] [--statistics]
                            [--machinereadable]

VBoxManage registervm

VBoxManage registervm       <filename>

VBoxManage unregistervm

VBoxManage unregistervm     <uuid>|<name> [--delete]

VBoxManage createvm

VBoxManage createvm         --name <name>
                            [--ostype <ostype>]
                            [--register]
                            [--basefolder <path> | --settingsfile <path>]
                            [--uuid <uuid>]

VBoxManage modifyvm

VBoxManage modifyvm         <uuid|name>
                            [--name <name>]
                            [--ostype <ostype>]
                            [--memory <memorysize in MB>]
                            [--vram <vramsize in MB>]
                            [--acpi on|off]
                            [--ioapic on|off]
                            [--pae on|off]
                            [--hwvirtex on|off]
                            [--nestedpaging on|off]
                            [--vtxvpid on|off]
                            [--cpuidset <leaf> <eax> <ebx> <ecx> <edx>]
                            [--cpuidremove <leaf>]
                            [--cpuidremoveall]
                            [--cpus <number>]
                            [--monitorcount <number>]
                            [--accelerate3d <on|off>]
                            [--accelerate2dvideo <on|off>]
                            [--firmware bios|efi|efi32|efi64]
                            [--bioslogofadein on|off]
                            [--bioslogofadeout on|off]
                            [--bioslogodisplaytime <msec>]
                            [--bioslogoimagepath <imagepath>]
                            [--biosbootmenu disabled|menuonly|messageandmenu]
                            [--biossystemtimeoffset <msec>]
                            [--biospxedebug on|off]
                            [--boot<1-4> none|floppy|dvd|disk|net>]
                            [--nic<1-N> none|null|nat|bridged|intnet|hostonly]
                            [--nictype<1-N> Am79C970A|Am79C973|
                                            82540EM|82543GC|82545EM|
                                            virtio]
                            [--cableconnected<1-N> on|off]
                            [--nictrace<1-N> on|off]
                            [--nictracefile<1-N> <filename>]
                            [--nicspeed<1-N> <kbps>]
                            [--bridgeadapter<1-N> none|<devicename>]
                            [--hostonlyadapter<1-N> none|<devicename>]
                            [--intnet<1-N> <network name>]
                            [--natnet<1-N> <network>|default]
                            [--macaddress<1-N> auto|<mac>]
                            [--uart<1-N> off|<I/O base> <IRQ>]
                            [--uartmode<1-N> disconnected|
                                             server <pipe>|
                                             client <pipe>|
                                             file <file>|
                                             <devicename>]
                            [--gueststatisticsinterval <seconds>]
                            [--audio none|null|coreaudio]
                            [--audiocontroller ac97|sb16]
                            [--clipboard disabled|hosttoguest|guesttohost|
                                         bidirectional]
                            [--vrdp on|off]
                            [--vrdpport default|<ports>]
                            [--vrdpaddress <host>]
                            [--vrdpauthtype null|external|guest]
                            [--vrdpmulticon on|off]
                            [--vrdpreusecon on|off]
                            [--usb on|off]
                            [--usbehci on|off]
                            [--snapshotfolder default|<path>]
                            [--teleporter on|off]
                            [--teleporterport <port>]
                            [--teleporteraddress <address|empty>
                            [--teleporterpassword <password>]
                            [--hardwareuuid <uuid>]

VBoxManage import

VBoxManage import           <ovf> [--dry-run|-n] [more options]
                            (run with -n to have options displayed
                             for a particular OVF)

VBoxManage export

VBoxManage export           <machines> --output|-o <ovf>
                            [--legacy09]
                            [--vsys <number of virtual system>]
                                    [--product <product name>]
                                    [--producturl <product url>]
                                    [--vendor <vendor name>]
                                    [--vendorurl <vendor url>]
                                    [--version <version info>]
                                    [--eula <license text>]
                                    [--eulafile <filename>]

VBoxManage startvm

VBoxManage startvm          <uuid>|<name>
                            [--type gui|sdl|vrdp|headless]

VBoxManage controlvm

VBoxManage controlvm        <uuid>|<name>
                            pause|resume|reset|poweroff|savestate|
                            acpipowerbutton|acpisleepbutton|
                            keyboardputscancode <hex> [<hex> ...]|
                            injectnmi|
                            setlinkstate<1-N> on|off |
                            nic<1-N> null|nat|bridged|intnet|hostonly
                                     [<devicename>] |
                            nictrace<1-N> on|off
                            nictracefile<1-N> <filename>
                            usbattach <uuid>|<address> |
                            usbdetach <uuid>|<address> |
                            vrdp on|off |
                            vrdpport default|<ports> |
                            setvideomodehint <xres> <yres> <bpp> [display] |
                            setcredentials <username> <password> <domain>
                                           [--allowlocallogon <yes|no>] |
                            teleport --host <name> --port <port>
                                   [--maxdowntime <msec>] [--password password]

VBoxManage discardstate

VBoxManage discardstate     <uuid>|<name>

VBoxManage adoptstate

VBoxManage adoptstate       <uuid>|<name> <state_file>

VBoxManage snapshot

VBoxManage snapshot         <uuid>|<name>
                            take <name> [--description <desc>] [--pause] |
                            delete <uuid>|<name> |
                            restore <uuid>|<name> |
                            restorecurrent |
                            edit <uuid>|<name>|--current
                                 [--name <name>]
                                 [--description <desc>] |
                            showvminfo <uuid>|<name>

VBoxManage openmedium

VBoxManage openmedium       disk|dvd|floppy <filename>
                            [--type normal|immutable|writethrough] (disk only)
                            [--uuid <uuid>]
                            [--parentuuid <uuid>] (disk only)

VBoxManage closemedium

VBoxManage closemedium      disk|dvd|floppy <uuid>|<filename>
                            [--delete]

VBoxManage storageattach

VBoxManage storageattach    <uuid|vmname>
                            --storagectl <name>
                            --port <number>
                            --device <number>
                            [--type <dvddrive|hdd|fdd>
                             --medium <none|emptydrive|uuid|filename|host:<drive>>]
                            [--passthrough <on|off>]
                            [--forceunmount]

VBoxManage storagectl

VBoxManage storagectl       <uuid|vmname>
                            --name <name>
                            [--add <ide/sata/scsi/floppy>]
                            [--controller <LsiLogic/BusLogic/IntelAhci/PIIX3/PIIX4/ICH6/I82078>]
                            [--sataideemulation<1-4> <1-30>]
                            [--sataportcount <1-30>]
                            [--remove]

VBoxManage showhdinfo

VBoxManage showhdinfo       <uuid>|<filename>

VBoxManage createhd

VBoxManage createhd         --filename <filename>
                            --size <megabytes>
                            [--format VDI|VMDK|VHD] (default: VDI)
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--type normal|writethrough] (default: normal)
                            [--comment <comment>]
                            [--remember]

VBoxManage modifyhd

VBoxManage modifyhd         <uuid>|<filename>
                            [--type normal|writethrough|immutable]
                            [--autoreset on|off]
                            [--compact]

VBoxManage clonehd

VBoxManage clonehd          <uuid>|<filename> <outputfile>
                            [--format VDI|VMDK|VHD|RAW|<other>]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--type normal|writethrough|immutable]
                            [--remember] [--existing]

VBoxManage convertfromraw

VBoxManage convertfromraw   <filename> <outputfile>
                            [--format VDI|VMDK|VHD]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
VBoxManage convertfromraw   stdin <outputfile> <bytes>
                            [--format VDI|VMDK|VHD]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]

VBoxManage addiscsidisk

VBoxManage addiscsidisk     --server <name>|<ip>
                            --target <target>
                            [--port <port>]
                            [--lun <lun>]
                            [--encodedlun <lun>]
                            [--username <username>]
                            [--password <password>]
                            [--type normal|writethrough|immutable]
                            [--intnet]

VBoxManage getextradata

VBoxManage getextradata     global|<uuid>|<name>
                            <key>|enumerate

VBoxManage setextradata

VBoxManage setextradata     global|<uuid>|<name>
                            <key>
                            [<value>] (no value deletes key)

VBoxManage setproperty

VBoxManage setproperty      hdfolder default|<folder> |
                            machinefolder default|<folder> |
                            vrdpauthlibrary default|<library> |
                            websrvauthlibrary default|null|<library> |
                            loghistorycount <value>

VBoxManage usbfilter

VBoxManage usbfilter        add <index,0-N>
                            --target <uuid>|<name>|global
                            --name <string>
                            --action ignore|hold (global filters only)
                            [--active yes|no] (yes)
                            [--vendorid <XXXX>] (null)
                            [--productid <XXXX>] (null)
                            [--revision <IIFF>] (null)
                            [--manufacturer <string>] (null)
                            [--product <string>] (null)
                            [--remote yes|no] (null, VM filters only)
                            [--serialnumber <string>] (null)
                            [--maskedinterfaces <XXXXXXXX>]

VBoxManage usbfilter        modify <index,0-N>
                            --target <uuid>|<name>|global
                            [--name <string>]
                            [--action ignore|hold] (global filters only)
                            [--active yes|no]
                            [--vendorid <XXXX>|""]
                            [--productid <XXXX>|""]
                            [--revision <IIFF>|""]
                            [--manufacturer <string>|""]
                            [--product <string>|""]
                            [--remote yes|no] (null, VM filters only)
                            [--serialnumber <string>|""]
                            [--maskedinterfaces <XXXXXXXX>]

VBoxManage usbfilter        remove <index,0-N>
                            --target <uuid>|<name>|global

VBoxManage sharedfolder

VBoxManage sharedfolder     add <vmname>|<uuid>
                            --name <name> --hostpath <hostpath>
                            [--transient] [--readonly]

VBoxManage sharedfolder     remove <vmname>|<uuid>
                            --name <name> [--transient]

VBoxManage vmstatistics

VBoxManage vmstatistics     <vmname>|<uuid> [--reset]
                            [--pattern <pattern>] [--descriptions]

VBoxManage guestproperty

VBoxManage guestproperty    get <vmname>|<uuid>
                            <property> [--verbose]

VBoxManage guestproperty    set <vmname>|<uuid>
                            <property> [<value> [--flags <flags>]]

VBoxManage guestproperty    enumerate <vmname>|<uuid>
                            [--patterns <patterns>]

VBoxManage guestproperty    wait <vmname>|<uuid> <patterns>
                            [--timeout <milliseconds>] [--fail-on-timeout]

VBoxManage metrics

VBoxManage metrics          list [*|host|<vmname> [<metric_list>]]
                                                 (comma-separated)

VBoxManage metrics          setup
                            [--period <seconds>]
                            [--samples <count>]
                            [--list]
                            [*|host|<vmname> [<metric_list>]]

VBoxManage metrics          query [*|host|<vmname> [<metric_list>]]

VBoxManage metrics          collect
                            [--period <seconds>]
                            [--samples <count>]
                            [--list]
                            [--detach]
                            [*|host|<vmname> [<metric_list>]]

VBoxManage hostonlyif

VBoxManage hostonlyif       ipconfig <name>
                            [--dhcp |
                            --ip<ipv4> [--netmask<ipv4> (def: 255.255.255.0)] |
                            --ipv6<ipv6> [--netmasklengthv6<length> (def: 64)]]

VBoxManage dhcpserver

VBoxManage dhcpserver       add|modify --netname <network_name> |
                                       --ifname <hostonly_if_name>
                                [--ip <ip_address>
                                 --netmask <network_mask>
                                 --lowerip <lower_ip>
                                 --upperip <upper_ip>]
                                [--enable | --disable]
VBoxManage dhcpserver       remove --netname <network_name> |
                                   --ifname <hostonly_if_name>

Formated with the following perl script:
while (defined($line=<STDIN>)) {
  if ($line =~ /^VBoxManage ([^ ]+) / and $topic ne $1) {
    $topic = $1;
    print "===== VBoxManage $1 =====\n";
  }
  print "  $line";
}
 
 
 
 
 
Original Post 
http://andunix.net/info/virtualbox/cli 

Friday, March 29, 2013

Move Virtual Box Virtual Machines to New Server/Location

Step 1: Locate and move the Virtual Machine
You will be looking for a .vdi file. The location of this file will depend upon the host platform. On Linux host, the file will be found in ~/VirtualBox VMs.

On Mac Host, the file will be found in Go>Home>VirtualBox VMs

Within that directory, you will find sub-directories of all your virtual machines. Within the virtual machine directory in question, you will find the .vdi file — that is, the file that must be moved to the new host. Copy that file to an external or shared drive and then copy it onto the new host (the location doesn’t matter).


Step 2: Create a new virtual machine
The process of creating the new virtual machine will be the same as if you were creating a standard virtual machine until you get to the Virtual Hard Disk creation screen (Figure-1). You will select Use Existing Hard Disk, click the folder icon, navigate to the newly copied .vdi file, select the file in question, and then click Next.



Step 3: Copy All MAC addressess
When you move your VM to new location it is good to copy your network card MAC address from Old Virtual Box and past into new Virtual Box virtual machine, For doing this you will not face any complicated network connectivity issue after starting your machine.

Follow the step below:

1..Select newly created Virtual machine in virtual box.
2..Click on setting
3..Click on Network
4..Delete existing MAC address and Past the same mac address as it was in old Virtual Box VM.
5..Do it with all network Cards.
6..Also make same setting for network like "NAT or Bridge" etc.


------------------------------------------------------------------------------------------------------


Since your mac address have changed you no longer have an interface called eth0, this name is reserved for an interface with the "old" mac-address. The "new" interface should have the next free name (eg. ethN).


To see all the interfaces on the machine you can use this command:

ifconfig -a

If you want to reset the name reservations for network interfaces you can remove the file

/etc/udev/rules.d/70-persistent-net.rules

and restart the machine (or remove/insert the device, though this is not possible in this case).

Alternatively you can change the interface-name that you have configured to what ever the new one is called by changing all occurences of the old name with the new one in the file


/etc/network/interfaces