现在的位置: 首页 > 综合 > 正文

Virtualbox命令行启动和操作虚拟机

2018年05月03日 ⁄ 综合 ⁄ 共 25490字 ⁄ 字号 评论关闭

例:启动虚拟机 VBoxManage startvm
vmname
--type headless

gui 正常UI

sdl 简单UI

headless 无UI

如果执行的过程中,提示没有找到虚拟机,但是列表中有虚拟机,应该检查是不是用户不一致导致的,比如root用户下执行此命令等

====================================================================

Oracle VM VirtualBox Command Line Management Interface Version 4.3.12
(C) 2005-2014 Oracle Corporation
All rights reserved.

Usage:

  VBoxManage [<general option>] <command>
 
 
General Options:
 
  [-v|--version]            print version number and exit
  [-q|--nologo]             suppress the logo
  [--settingspw <pw>]       provide the settings password
  [--settingspwfile <file>] provide a file containing the settings password
 
 
Commands:
 
  list [--long|-l]          vms|runningvms|ostypes|hostdvds|hostfloppies|
                            intnets|bridgedifs|hostonlyifs|natnets|dhcpservers|
                            hostinfo|hostcpuids|hddbackends|hdds|dvds|floppies|
                            usbhost|usbfilters|systemproperties|extpacks|
                            groups|webcams

  showvminfo                <uuid|vmname> [--details]
                            [--machinereadable]
  showvminfo                <uuid|vmname> --log <idx>

  registervm                <filename>

  unregistervm              <uuid|vmname> [--delete]

  createvm                  --name <name>
                            [--groups <group>, ...]
                            [--ostype <ostype>]
                            [--register]
                            [--basefolder <path>]
                            [--uuid <uuid>]

  modifyvm                  <uuid|vmname>
                            [--name <name>]
                            [--groups <group>, ...]
                            [--ostype <ostype>]
                            [--iconfile <filename>]
                            [--memory <memorysize in MB>]
                            [--pagefusion on|off]
                            [--vram <vramsize in MB>]
                            [--acpi on|off]
                            [--pciattach 03:04.0]
                            [--pciattach 03:04.0@02:01.0]
                            [--pcidetach 03:04.0]
                            [--ioapic on|off]
                            [--hpet on|off]
                            [--triplefaultreset on|off]
                            [--hwvirtex on|off]
                            [--nestedpaging on|off]
                            [--largepages on|off]
                            [--vtxvpid on|off]
                            [--vtxux on|off]
                            [--pae on|off]
                            [--longmode on|off]
                            [--synthcpu on|off]
                            [--cpuidset <leaf> <eax> <ebx> <ecx> <edx>]
                            [--cpuidremove <leaf>]
                            [--cpuidremoveall]
                            [--hardwareuuid <uuid>]
                            [--cpus <number>]
                            [--cpuhotplug on|off]
                            [--plugcpu <id>]
                            [--unplugcpu <id>]
                            [--cpuexecutioncap <1-100>]
                            [--rtcuseutc on|off]
                            [--graphicscontroller none|vboxvga|vmsvga]
                            [--monitorcount <number>]
                            [--accelerate3d on|off]
                            [--accelerate2dvideo on|off]
                            [--firmware bios|efi|efi32|efi64]
                            [--chipset ich9|piix3]
                            [--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|
                                        generic|natnetwork]
                            [--nictype<1-N> Am79C970A|Am79C973|
                                            82540EM|82543GC|82545EM|
                                            virtio]
                            [--cableconnected<1-N> on|off]
                            [--nictrace<1-N> on|off]
                            [--nictracefile<1-N> <filename>]
                            [--nicproperty<1-N> name=[value]]
                            [--nicspeed<1-N> <kbps>]
                            [--nicbootprio<1-N> <priority>]
                            [--nicpromisc<1-N> deny|allow-vms|allow-all]
                            [--nicbandwidthgroup<1-N> none|<name>]
                            [--bridgeadapter<1-N> none|<devicename>]
                            [--hostonlyadapter<1-N> none|<devicename>]
                            [--intnet<1-N> <network name>]
                            [--nat-network<1-N> <network name>]
                            [--nicgenericdrv<1-N> <driver>
                            [--natnet<1-N> <network>|default]
                            [--natsettings<1-N> [<mtu>],[<socksnd>],
                                                [<sockrcv>],[<tcpsnd>],
                                                [<tcprcv>]]
                            [--natpf<1-N> [<rulename>],tcp|udp,[<hostip>],
                                          <hostport>,[<guestip>],<guestport>]
                            [--natpf<1-N> delete <rulename>]
                            [--nattftpprefix<1-N> <prefix>]
                            [--nattftpfile<1-N> <file>]
                            [--nattftpserver<1-N> <ip>]
                            [--natbindip<1-N> <ip>
                            [--natdnspassdomain<1-N> on|off]
                            [--natdnsproxy<1-N> on|off]
                            [--natdnshostresolver<1-N> on|off]
                            [--nataliasmode<1-N> default|[log],[proxyonly],
                                                         [sameports]]
                            [--macaddress<1-N> auto|<mac>]
                            [--mouse ps2|usb|usbtablet|usbmultitouch]
                            [--keyboard ps2|usb
                            [--uart<1-N> off|<I/O base> <IRQ>]
                            [--uartmode<1-N> disconnected|
                                             server <pipe>|
                                             client <pipe>|
                                             file <file>|
                                             <devicename>]
                            [--lpt<1-N> off|<I/O base> <IRQ>]
                            [--lptmode<1-N> <devicename>]
                            [--guestmemoryballoon <balloonsize in MB>]
                            [--audio none|null|oss|alsa|pulse]
                            [--audiocontroller ac97|hda|sb16]
                            [--clipboard disabled|hosttoguest|guesttohost|
                                         bidirectional]
                            [--draganddrop disabled|hosttoguest
                            [--vrde on|off]
                            [--vrdeextpack default|<name>
                            [--vrdeproperty <name=[value]>]
                            [--vrdeport <hostport>]
                            [--vrdeaddress <hostip>]
                            [--vrdeauthtype null|external|guest]
                            [--vrdeauthlibrary default|<name>
                            [--vrdemulticon on|off]
                            [--vrdereusecon on|off]
                            [--vrdevideochannel on|off]
                            [--vrdevideochannelquality <percent>]
                            [--usb on|off]
                            [--usbehci on|off]
                            [--snapshotfolder default|<path>]
                            [--teleporter on|off]
                            [--teleporterport <port>]
                            [--teleporteraddress <address|empty>
                            [--teleporterpassword <password>]
                            [--teleporterpasswordfile <file>|stdin]
                            [--tracing-enabled on|off]
                            [--tracing-config <config-string>]
                            [--tracing-allow-vm-access on|off]
                            [--usbcardreader on|off]
                            [--autostart-enabled on|off]
                            [--autostart-delay <seconds>]
                            [--vcpenabled on|off]
                            [--vcpscreens [<display>],...
                            [--vcpfile <filename>]
                            [--vcpwidth <width>]
                            [--vcpheight <height>]
                            [--vcprate <rate>]
                            [--vcpfps <fps>]
                            [--defaultfrontend default|<name>]

  clonevm                   <uuid|vmname>
                            [--snapshot <uuid>|<name>]
                            [--mode machine|machineandchildren|all]
                            [--options link|keepallmacs|keepnatmacs|
                                       keepdisknames]
                            [--name <name>]
                            [--groups <group>, ...]
                            [--basefolder <basefolder>]
                            [--uuid <uuid>]
                            [--register]

  import                    <ovfname/ovaname>
                            [--dry-run|-n]
                            [--options keepallmacs|keepnatmacs]
                            [more options]
                            (run with -n to have options displayed
                             for a particular OVF)

  export                    <machines> --output|-o <name>.<ovf/ova>
                            [--legacy09|--ovf09|--ovf10|--ovf20]
                            [--manifest]
                            [--iso]
                            [--options manifest|iso|nomacs|nomacsbutnat]
                            [--vsys <number of virtual system>]
                                    [--product <product name>]
                                    [--producturl <product url>]
                                    [--vendor <vendor name>]
                                    [--vendorurl <vendor url>]
                                    [--version <version info>]
                                    [--description <description info>]
                                    [--eula <license text>]
                                    [--eulafile <filename>]

  startvm                   <uuid|vmname>...
                            [--type gui|sdl|headless]

  controlvm                 <uuid|vmname>
                            pause|resume|reset|poweroff|savestate|
                            acpipowerbutton|acpisleepbutton|
                            keyboardputscancode <hex> [<hex> ...]|
                            setlinkstate<1-N> on|off |
                            nic<1-N> null|nat|bridged|intnet|hostonly|generic|
                                     natnetwork [<devicename>] |
                            nictrace<1-N> on|off |
                            nictracefile<1-N> <filename> |
                            nicproperty<1-N> name=[value] |
                            nicpromisc<1-N> deny|allow-vms|allow-all |
                            natpf<1-N> [<rulename>],tcp|udp,[<hostip>],
                                        <hostport>,[<guestip>],<guestport> |
                            natpf<1-N> delete <rulename> |
                            guestmemoryballoon <balloonsize in MB> |
                            usbattach <uuid>|<address> |
                            usbdetach <uuid>|<address> |
                            clipboard disabled|hosttoguest|guesttohost|
                                      bidirectional |
                            draganddrop disabled|hosttoguest |
                            vrde on|off |
                            vrdeport <port> |
                            vrdeproperty <name=[value]> |
                            vrdevideochannelquality <percent> |
                            setvideomodehint <xres> <yres> <bpp>
                                            [[<display>] [<enabled:yes|no> |
                                              [<xorigin> <yorigin>]]] |
                            screenshotpng <file> [display] |
                            vcpenabled on|off |
                            vcpscreens all|none|<screen>,[<screen>...] |
                            setcredentials <username>
                                           --passwordfile <file> | <password>
                                           <domain>
                                           [--allowlocallogon <yes|no>] |
                            teleport --host <name> --port <port>
                                     [--maxdowntime <msec>]
                                     [--passwordfile <file> |
                                      --password <password>] |
                            plugcpu <id> |
                            unplugcpu <id> |
                            cpuexecutioncap <1-100>
                            webcam <attach [path [settings]]> | <detach [path]> | <list>

  discardstate              <uuid|vmname>

  adoptstate                <uuid|vmname> <state_file>

  snapshot                  <uuid|vmname>
                            take <name> [--description <desc>] [--live] |
                            delete <uuid|snapname> |
                            restore <uuid|snapname> |
                            restorecurrent |
                            edit <uuid|snapname>|--current
                                 [--name <name>]
                                 [--description <desc>] |
                            list [--details|--machinereadable]
                            showvminfo <uuid|snapname>

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

  storageattach             <uuid|vmname>
                            --storagectl <name>
                            [--port <number>]
                            [--device <number>]
                            [--type dvddrive|hdd|fdd]
                            [--medium none|emptydrive|additions|
                                      <uuid|filename>|host:<drive>|iscsi]
                            [--mtype normal|writethrough|immutable|shareable|
                                     readonly|multiattach]
                            [--comment <text>]
                            [--setuuid <uuid>]
                            [--setparentuuid <uuid>]
                            [--passthrough on|off]
                            [--tempeject on|off]
                            [--nonrotational on|off]
                            [--discard on|off]
                            [--bandwidthgroup <name>]
                            [--forceunmount]
                            [--server <name>|<ip>]
                            [--target <target>]
                            [--tport <port>]
                            [--lun <lun>]
                            [--encodedlun <lun>]
                            [--username <username>]
                            [--password <password>]
                            [--initiator <initiator>]
                            [--intnet]

  storagectl                <uuid|vmname>
                            --name <name>
                            [--add ide|sata|scsi|floppy|sas]
                            [--controller LSILogic|LSILogicSAS|BusLogic|
                                          IntelAHCI|PIIX3|PIIX4|ICH6|I82078]
                            [--portcount <1-30>]
                            [--hostiocache on|off]
                            [--bootable on|off]
                            [--remove]

  bandwidthctl              <uuid|vmname>
                            add <name> --type disk|network
                                --limit <megabytes per second>[k|m|g|K|M|G] |
                            set <name>
                                --limit <megabytes per second>[k|m|g|K|M|G] |
                            remove <name> |
                            list [--machinereadable]
                            (limit units: k=kilobit, m=megabit, g=gigabit,
                                          K=kilobyte, M=megabyte, G=gigabyte)

  showhdinfo                <uuid|filename>

  createhd                  --filename <filename>
                            [--size <megabytes>|--sizebyte <bytes>]
                            [--diffparent <uuid>|<filename>
                            [--format VDI|VMDK|VHD] (default: VDI)
                            [--variant Standard,Fixed,Split2G,Stream,ESX]

  modifyhd                  <uuid|filename>
                            [--type normal|writethrough|immutable|shareable|
                                    readonly|multiattach]
                            [--autoreset on|off]
                            [--property <name=[value]>]
                            [--compact]
                            [--resize <megabytes>|--resizebyte <bytes>]

  clonehd                   <uuid|inputfile> <uuid|outputfile>
                            [--format VDI|VMDK|VHD|RAW|<other>]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--existing]

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

  getextradata              global|<uuid|vmname>
                            <key>|enumerate

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

  setproperty               machinefolder default|<folder> |
                            hwvirtexclusive on|off |
                            vrdeauthlibrary default|<library> |
                            websrvauthlibrary default|null|<library> |
                            vrdeextpack null|<library> |
                            autostartdbpath null|<folder> |
                            loghistorycount <value>
                            defaultfrontend default|<name>

  usbfilter                 add <index,0-N>
                            --target <uuid|vmname>|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>]

  usbfilter                 modify <index,0-N>
                            --target <uuid|vmname>|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>]

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

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

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

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

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

  guestproperty             delete|unset <uuid|vmname>
                            <property>

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

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

  guestcontrol              <uuid|vmname>

                              exec[ute]
                              --image <path to program> --username <name>
                              [--passwordfile <file> | --password <password>]
                              [--domain <domain>] [--verbose] [--timeout <msec>]
                              [--environment "<NAME>=<VALUE> [<NAME>=<VALUE>]"]
                              [--wait-exit] [--wait-stdout] [--wait-stderr]
                              [--dos2unix] [--unix2dos]
                              [-- [<argument1>] ... [<argumentN>]]

                              copyfrom
                              <guest source> <host dest> --username <name>
                              [--passwordfile <file> | --password <password>]
                              [--domain <domain>] [--verbose]
                              [--dryrun] [--follow] [--recursive]

                              copyto|cp
                              <host source> <guest dest> --username <name>
                              [--passwordfile <file> | --password <password>]
                              [--domain <domain>] [--verbose]
                              [--dryrun] [--follow] [--recursive]

                              createdir[ectory]|mkdir|md
                              <guest directory>... --username <name>
                              [--passwordfile <file> | --password <password>]
                              [--domain <domain>] [--verbose]
                              [--parents] [--mode <mode>]

                              removedir[ectory]|rmdir
                              <guest directory>... --username <name>
                              [--passwordfile <file> | --password <password>]
                              [--domain <domain>] [--verbose]
                              [--recursive|-R|-r]

                              removefile|rm
                              <guest file>... --username <name>
                              [--passwordfile <file> | --password <password>]
                              [--domain <domain>] [--verbose]

                              ren[ame]|mv
                              <source>... <dest> --username <name>
                              [--passwordfile <file> | --password <password>]
                              [--domain <domain>] [--verbose]

                              createtemp[orary]|mktemp
                              <template> --username <name>
                              [--passwordfile <file> | --password <password>]
                              [--directory] [--secure] [--tmpdir <directory>]
                              [--domain <domain>] [--mode <mode>] [--verbose]

                              list <all|sessions|processes|files> [--verbose]

                              process kill --session-id <ID>
                                           | --session-name <name or pattern>
                                           [--verbose]
                                           <PID> ... <PID n>

                              [p[s]]kill --session-id <ID>
                                         | --session-name <name or pattern>
                                         [--verbose]
                                         <PID> ... <PID n>

                              session close  --session-id <ID>
                                           | --session-name <name or pattern>
                                           | --all
                                           [--verbose]

                              stat
                              <file>... --username <name>
                              [--passwordfile <file> | --password <password>]
                              [--domain <domain>] [--verbose]

                              updateadditions
                              [--source <guest additions .ISO>] [--verbose]
                              [--wait-start]
                              [-- [<argument1>] ... [<argumentN>]]

                              watch [--verbose]

  debugvm                   <uuid|vmname>
                            dumpguestcore --filename <name> |
                            info <item> [args] |
                            injectnmi |
                            log [--release|--debug] <settings> ...|
                            logdest [--release|--debug] <settings> ...|
                            logflags [--release|--debug] <settings> ...|
                            osdetect |
                            osinfo |
                            getregisters [--cpu <id>] <reg>|all ... |
                            setregisters [--cpu <id>] <reg>=<value> ... |
                            show [--human-readable|--sh-export|--sh-eval|
                                  --cmd-set] 
                                <logdbg-settings|logrel-settings>
                                [[opt] what ...] |
                            statistics [--reset] [--pattern <pattern>]
                            [--descriptions]

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

  metrics                   setup
                            [--period <seconds>] (default: 1)
                            [--samples <count>] (default: 1)
                            [--list]
                            [*|host|<vmname> [<metric_list>]]

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

  metrics                   enable
                            [--list]
                            [*|host|<vmname> [<metric_list>]]

  metrics                   disable
                            [--list]
                            [*|host|<vmname> [<metric_list>]]

  metrics                   collect
                            [--period <seconds>] (default: 1)
                            [--samples <count>] (default: 1)
                            [--list]
                            [--detach]
                            [*|host|<vmname> [<metric_list>]]

  natnetwork                add --netname <name>
                            --network <network>
                            [--enable|--disable]
                            [--dhcp on|off]
                            [--port-forward-4 <rule>]
                            [--loopback-4 <rule>]
                            [--ipv6 on|off]
                            [--port-forward-6 <rule>]
                            [--loopback-6 <rule>]

  natnetwork                remove --netname <name>

  natnetwork                modify --netname <name>
                            [--network <network>]
                            [--enable|--disable]
                            [--dhcp on|off]
                            [--port-forward-4 <rule>]
                            [--loopback-4 <rule>]
                            [--ipv6 on|off]
                            [--port-forward-6 <rule>]
                            [--loopback-6 <rule>]

  natnetwork                start --netname <name>

  natnetwork                stop --netname <name>

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

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

  dhcpserver                remove --netname <network_name> |
                                   --ifname <hostonly_if_name>

  extpack                   install [--replace] <tarball> |
                            uninstall [--force] <name> |
                            cleanup

VBoxManage [-v|-version] 显示virtualbox的版本号
VBoxManage -nologo 隐藏logo
VBoxManage -convertSettings 允许自动转换设置文件
VBoxManage -convertSettingsBackup 允许自动转换设置文件,并在转换前作备份
VBoxManage -convertSettingsIgnore 允许自动转换设置文件,但是不保存结果

VBoxManage list vms|runningvms 显示列表虚拟机|正在运行的虚拟机
|ostypes|hostdvds virtualbox支持的系统类型|宿主机的光盘驱动器
|hostfloppies 宿主机的软盘驱动器
|hostifs|hostinfo 宿主机的网络接口|宿主机的信息
|hdds|dvds 已注册的虚拟硬盘|已注册的虚拟光盘
|floppies|usbhost 已注册的虚拟软盘|宿主机的USB设备
|usbfilters USB筛选器
|systemproperties 虚拟机的基本信息

VBoxManage showvminfo | 显示指定虚拟机的信息
[-details] 显示详细信息
[-statistics] 显示统计信息
[-machinereadable] 以清晰的格式显示虚拟机信息

VBoxManage registervm 将指定文件所在的虚拟机添加到列表

VBoxManage unregistervm | 从虚拟机列表清除指定的虚拟机
[-delete] 从虚拟机列表删除指定的虚拟机

VBoxManage createvm -name 创建指定名称的虚拟机
[-register] 将创建的虚拟机添加到列表
[-basefolder指定虚拟机的基础目录
[-settingsfile] 指定虚拟机配置文件的基础目录
[-uuid ] 创建指定uuid的虚拟机

VBoxManage modifyvm 编辑指定的虚拟机的配置
[-name ] 修改虚拟机的名称
[-ostype ]修改虚拟机的操作系统类型
[-memory ] 修改虚拟机的内存大小
[-vram ] 修改虚拟机的显存大小
[-acpi on|off] 启动或禁止acpi电源管理接口
[-ioapic on|off] 启动或禁止I/O APIC电源管理接口
[-pae on|off] 启动或禁止CPU的PAE支持,PAE是
Physical Address Extension : 物理地址扩展
[-hwvirtex on|off|default]启动或禁止CPU的硬件虚拟化支持
[-nestedpaging on|off] 开启或关闭CPU的嵌套页面列表支持
[-monitorcount ] 设置显示器数目,VRDP多用户模式时 [-bioslogofadein on|off] 开启或关闭bioslogo渐显效果
[-bioslogofadeout on|off] 开启或关闭bioslogo渐隐效果
[-bioslogodisplaytime ]设置bioslogo显示时间(以毫秒为单位)
[-bioslogoimagepath ]设置bioslogo图像路径,用于自定义bioslogo
[-biosbootmenu disabled| 设置是否显示bios启动菜单 关闭
menuonly| 只菜单
messageandmenu] 信息和菜单
[-biossystemtimeoffset ] 设置bios系统时间补偿(以毫秒为单位)
[-biospxedebug on|off] 打开或关闭biospxe调试
[-boot<1-4> none|floppy|dvd|disk|net>] 设置启动顺序
[-hd none||] 为虚拟机添加三个IDE设备之一(第2个主盘被vm保留作为光驱,不能占用)在三个IDE中,你可以指定(硬盘)的vdi文件名或者它的UUID
[-idecontroller PIIX3|PIIX4] 设置IDE控制器的类型
[-sata on|off] 开启或关闭SATA硬盘控制器
[-sataportcount <1-30>] 设置虚拟机最多支持的SATA控制器数目
[-sataport<1-30> none| 没有硬盘连接到SATA控制器
| 指定uuid的硬盘连接到SATA控制器
] 指定文件名的硬盘连接到SATA控制器
[-sataideemulation<1-4> <1-30>] 指定一个SATA设备工作在IDE兼容模式,IDE设备编号是1-4,SATA设备编号是1-30
[-dvd none| 不连接DVD光驱
| 指定UUID的DVD光驱连接
| 将指定的光盘映像文件挂接到DVD光驱
host:] 将宿主机的DVD光驱挂接到虚拟机的DVD光驱
[-dvdpassthrough on|off]打开|关闭虚拟机里光盘的刻录功能
[-floppy disabled| 不连接软驱
empty| 连接软驱但不插入软盘
| 指定UUID的软驱连接
| 将指定的软盘映像文件挂接到软驱驱
host:] 将宿主机的软驱驱挂接到虚拟机的软驱
[-nic<1-N> none| 虚拟机不添加网卡
null| 虚拟机有网卡但不连接
nat| 网络连接使用NAT模式
hostif| 网络连接使用桥接模式
intnet] 网络连接使用内部网络模式
[-nictype<1-N> Am79C970A| 虚拟机连接AMD PCNet PCI II网卡
Am79C973| 虚拟机连接AMD PCNet FAST III网卡(默认)
82540EM| 虚拟机连接Intel PRO/1000 MT Desktop网卡
82543GC] 虚拟机连接Intel PRO/1000 T Server网卡
[-cableconnected<1-N> on|off]插入或拔出网线
[-nictrace<1-N> on|off] 开启或关闭网络追踪
[-nictracefile<1-N> ] 将网络流量追踪数据保存到文件
[-nicspeed<1-N> ] 设置网络连接的速度
[-hostifdev<1-N> none| 不连接到主机网络接口
] 桥接模式下连接到指定的主机接口
[-intnet<1-N> ] 内网模式下为虚拟机指定内部网络名称
[-natnet<1-N> | 配置NAT网络接口的地址
default] 默认NAT网络接口的地址是10.0.x.0/24
[-macaddress<1-N> auto| 自动生成虚拟网卡的MAC地址
] 指定虚拟网卡的MAC地址
[-uart<1-N> off| 不启用虚拟串口
]启用虚拟串口,并设置虚拟串口的I/O参数和IRQ参数
[-uartmode<1-N> disconnected| 启用虚拟串口,但不连接到宿主机的串口
server| 在宿主机创建PIPE通道,并将虚拟机串口连接到这个通道
client| 不创建PIPE通道,而是将虚拟机串口连接到已存在的通道
] 将虚拟机串口连接到宿主机的串口
[-gueststatisticsinterval ] 配置虚拟机静态时间间隔
[-audio none| 虚拟机不连接声卡
null| 将虚拟机的声卡连接到空的声音设备
dsound] 将虚拟机的声卡连接到宿主机的声卡
[-audiocontroller ac97| 将虚拟机声卡虚拟为ICH AC97声卡
sb16] 将虚拟机声卡虚拟为soundblaster 16声卡
[-clipboard disabled| 不共享剪贴板
hosttoguest| 将宿主机的剪贴板共享给虚拟机
guesttohost| 将虚拟机的剪贴板共享给宿主机
bidirectional] 宿主机和虚拟机共使用一个剪贴板
[-vrdp on|off] 开启|关闭virtualbox内置的VRDP服务器
[-vrdpport default| 使用默认的vrdp端口3389

] 指定vrdp端口
[-vrdpaddress ] 指定VRDP主机地址
[-vrdpauthtype null| 不用授权,任何客户机都可以连接到VRDP服务器
external| 只有宿主机的用户才可以连接到VRDP服务器
guest] 只有虚拟机的用户才可以连接到VRDP服务器
[-vrdpmulticon on|off] 打开|关闭VRDP多用户连接模式
[-vrdpreusecon on|off] 打开|关闭VRDP断线重连
[-usb on|off] 打开|关闭虚拟USB控制器
[-usbehci on|off] 打开|关闭虚拟USB2.0控制器
[-snapshotfolder default| 将系统快照保存到默认文件夹

] 将系统快照保存到指定文件夹

VBoxManage startvm | 开启指定UUID|名称的虚拟机
[-type gui|vrdp] 设置虚拟机标准显示设备GUI界面|VRDP

VBoxManage controlvm | 改变正在运行的虚拟机的状态
pause| 暂停,这时虚拟机窗口显示灰色
resume| 恢复暂停的虚拟机
reset| 复位
poweroff| 强行关闭
acpipowerbutton| 关机
acpisleepbutton| 使虚拟机处于睡眠状态
savestate| 保存状态然后关闭,相当于休眠
keyboardputscancode [ ...] 键盘扫描码设置
setlinkstate<1-4> on|off 连接|断开网络连接
usbattach |

连接到指定UUDI|地址的USB设备
usbdetach |
断开指定UUDI|地址的USB设备
dvdattach none| 不连接虚拟DVD光驱
| 连接到指定UUID的DVD光驱
| 连接到指定名称的DVD映像文件
host: 连接到宿主机的DVD光驱
floppyattach none| 不连接虚拟软驱
| 连接到指定UUID的虚拟软驱
| 连接到指定名称的软盘映像文件
host: 连接到宿主机的软驱

setvideomodehint 设置虚拟机的屏幕分辨率 水平像素
垂直像素
颜色深度
[display] 刷新频率
setcredentials 指定VRDP自动连接参数 用户名

密码

[-allowlocallogon ] 允许|禁止本地登陆

VBoxManage discardstate | 丢弃指定UUID|名称的虚拟机的保存状态

VBoxManage adoptstate | 将虚拟机从指定的保存状态中恢复

VBoxManage snapshot | 为指定的虚拟机拍快照
take 为快照取名
[-desc ]| 给快照添加描述
discard | | 丢弃指定的快照
discardcurrent -state| 恢复到最近的快照
-all | 恢复到倒数第二个快照
edit || 编辑指定的快照
-current 编辑当前快照
[-newname ] 修改快照名称
[-newdesc ] 修改快照描述
showvminfo | 显示快照的虚拟机信息

VBoxManage registerimage disk|dvd|floppy 注册硬盘、光盘、软盘映像文件
[-type normal| 注册为普通类型(可创建快照,可读写)
immutable| 注册为只读类型(相当于加了硬盘卡)
writethrough] 注册为可写类型(这种类型不能创建快照)
(disk only) (注册类型选项只适用于硬盘)

VBoxManage unregisterimage disk| 从虚拟介质管理器删除指定的硬盘
dvd| 从虚拟介质管理器删除指定的DVD光盘
floppy 从虚拟介质管理器删除指定的软盘
| 删除时指定UUID
删除时指定映像文件

VBoxManage showvdiinfo | 显示指定UUID|名称虚拟硬盘的信息

VBoxManage createvdi -filename 创建指定名称的虚拟硬盘
-size 指定虚拟硬盘的大小(以兆为单位)
[-static] 创建固定大小的虚拟硬盘
[-comment

抱歉!评论已关闭.