VBoxManageModifyVM.cpp revision a9315925c69e4c3bb342bb317ca5b6d29e1ee467
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync * VBoxManage - Implementation of modifyvm command.
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync * Copyright (C) 2006-2012 Oracle Corporation
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync * available from http://www.virtualbox.org. This file is free software;
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync * you can redistribute it and/or modify it under the terms of the GNU
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync * General Public License (GPL) as published by the Free Software
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync/*******************************************************************************
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync* Header Files *
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync*******************************************************************************/
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync#endif /* !VBOX_ONLY_DOCS */
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsyncusing namespace com;
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync/** @todo refine this after HDD changes; MSC 8.0/64 has trouble with handleModifyVM. */
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync MODIFYVM_VRDPVIDEOCHANNELQUALITY, /* VRDE: deprecated */
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--ostype", MODIFYVM_OSTYPE, RTGETOPT_REQ_STRING },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--memory", MODIFYVM_MEMORY, RTGETOPT_REQ_UINT32 },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--pagefusion", MODIFYVM_PAGEFUSION, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--firmware", MODIFYVM_FIRMWARE, RTGETOPT_REQ_STRING },
eaae6c3ce81916ccc4e74af4b55972ba956cf5c8vboxsync { "--acpi", MODIFYVM_ACPI, RTGETOPT_REQ_BOOL_ONOFF },
eaae6c3ce81916ccc4e74af4b55972ba956cf5c8vboxsync { "--ioapic", MODIFYVM_IOAPIC, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--pae", MODIFYVM_PAE, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--synthcpu", MODIFYVM_SYNTHCPU, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--hwvirtex", MODIFYVM_HWVIRTEX, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--hwvirtexexcl", MODIFYVM_HWVIRTEXEXCLUSIVE, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--nestedpaging", MODIFYVM_NESTEDPAGING, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--largepages", MODIFYVM_LARGEPAGES, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--vtxvpid", MODIFYVM_VTXVPID, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--cpuidset", MODIFYVM_SETCPUID, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_HEX},
2b14f26c96a20e40e9a0c9e3c41b41315f6c6e96vboxsync { "--cpuidremove", MODIFYVM_DELCPUID, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_HEX},
8077a3fb4024022d405598797d3ed75c667a912fvboxsync { "--cpuidremoveall", MODIFYVM_DELALLCPUID, RTGETOPT_REQ_NOTHING},
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--cpuhotplug", MODIFYVM_CPUHOTPLUG, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--plugcpu", MODIFYVM_PLUGCPU, RTGETOPT_REQ_UINT32 },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--unplugcpu", MODIFYVM_UNPLUGCPU, RTGETOPT_REQ_UINT32 },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--cpuexecutioncap", MODIFYVM_CPU_EXECTUION_CAP, RTGETOPT_REQ_UINT32 },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--rtcuseutc", MODIFYVM_RTCUSEUTC, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--monitorcount", MODIFYVM_MONITORCOUNT, RTGETOPT_REQ_UINT32 },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--accelerate3d", MODIFYVM_ACCELERATE3D, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--accelerate2dvideo", MODIFYVM_ACCELERATE2DVIDEO, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--bioslogofadein", MODIFYVM_BIOSLOGOFADEIN, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--bioslogofadeout", MODIFYVM_BIOSLOGOFADEOUT, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--bioslogodisplaytime", MODIFYVM_BIOSLOGODISPLAYTIME, RTGETOPT_REQ_UINT32 },
c0ae9fb031e70c0e5f4098a46ab11262097c88f9vboxsync { "--bioslogoimagepath", MODIFYVM_BIOSLOGOIMAGEPATH, RTGETOPT_REQ_STRING },
c0ae9fb031e70c0e5f4098a46ab11262097c88f9vboxsync { "--biosbootmenu", MODIFYVM_BIOSBOOTMENU, RTGETOPT_REQ_STRING },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--biossystemtimeoffset", MODIFYVM_BIOSSYSTEMTIMEOFFSET, RTGETOPT_REQ_INT64 },
c0ae9fb031e70c0e5f4098a46ab11262097c88f9vboxsync { "--biospxedebug", MODIFYVM_BIOSPXEDEBUG, RTGETOPT_REQ_BOOL_ONOFF },
4b0369e0c9bcae37f2801e0f7b92509bbbaf4becvboxsync { "--boot", MODIFYVM_BOOT, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
fb846a5cde5068b8fc9880a7b59ab1dbc01c1680vboxsync { "--idecontroller", MODIFYVM_IDECONTROLLER, RTGETOPT_REQ_STRING },
8077a3fb4024022d405598797d3ed75c667a912fvboxsync { "--sataideemulation", MODIFYVM_SATAIDEEMULATION, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_INDEX },
eaae6c3ce81916ccc4e74af4b55972ba956cf5c8vboxsync { "--sataportcount", MODIFYVM_SATAPORTCOUNT, RTGETOPT_REQ_UINT32 },
eaae6c3ce81916ccc4e74af4b55972ba956cf5c8vboxsync { "--sataport", MODIFYVM_SATAPORT, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--scsiport", MODIFYVM_SCSIPORT, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--scsitype", MODIFYVM_SCSITYPE, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--dvdpassthrough", MODIFYVM_DVDPASSTHROUGH, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--floppy", MODIFYVM_FLOPPY, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--nictracefile", MODIFYVM_NICTRACEFILE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--nictrace", MODIFYVM_NICTRACE, RTGETOPT_REQ_BOOL_ONOFF | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--nicproperty", MODIFYVM_NICPROPERTY, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--nictype", MODIFYVM_NICTYPE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--nicspeed", MODIFYVM_NICSPEED, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--nicbootprio", MODIFYVM_NICBOOTPRIO, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--nicpromisc", MODIFYVM_NICPROMISC, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--nicbandwidthgroup", MODIFYVM_NICBWGROUP, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--nic", MODIFYVM_NIC, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--cableconnected", MODIFYVM_CABLECONNECTED, RTGETOPT_REQ_BOOL_ONOFF | RTGETOPT_FLAG_INDEX },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--bridgeadapter", MODIFYVM_BRIDGEADAPTER, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--hostonlyadapter", MODIFYVM_HOSTONLYADAPTER, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--intnet", MODIFYVM_INTNET, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--natnet", MODIFYVM_NATNET, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--nicgenericdrv", MODIFYVM_GENERICDRV, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--natbindip", MODIFYVM_NATBINDIP, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--natsettings", MODIFYVM_NATSETTINGS, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--natpf", MODIFYVM_NATPF, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--nataliasmode", MODIFYVM_NATALIASMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--nattftpprefix", MODIFYVM_NATTFTPPREFIX, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--nattftpfile", MODIFYVM_NATTFTPFILE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
eaae6c3ce81916ccc4e74af4b55972ba956cf5c8vboxsync { "--nattftpserver", MODIFYVM_NATTFTPSERVER, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--natdnspassdomain", MODIFYVM_NATDNSPASSDOMAIN, RTGETOPT_REQ_BOOL_ONOFF | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--natdnsproxy", MODIFYVM_NATDNSPROXY, RTGETOPT_REQ_BOOL_ONOFF | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--natdnshostresolver", MODIFYVM_NATDNSHOSTRESOLVER, RTGETOPT_REQ_BOOL_ONOFF | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--macaddress", MODIFYVM_MACADDRESS, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--mouse", MODIFYVM_HIDPTR, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--keyboard", MODIFYVM_HIDKBD, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--uartmode", MODIFYVM_UARTMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--uart", MODIFYVM_UART, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--lptmode", MODIFYVM_LPTMODE, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
eaae6c3ce81916ccc4e74af4b55972ba956cf5c8vboxsync { "--lpt", MODIFYVM_LPT, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--guestmemoryballoon", MODIFYVM_GUESTMEMORYBALLOON, RTGETOPT_REQ_UINT32 },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--audiocontroller", MODIFYVM_AUDIOCONTROLLER, RTGETOPT_REQ_STRING },
cb5363b6fa48f10b080cb6195f56c0823f7c0b0fvboxsync { "--audio", MODIFYVM_AUDIO, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--clipboard", MODIFYVM_CLIPBOARD, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrdpport", MODIFYVM_VRDPPORT, RTGETOPT_REQ_STRING }, /* deprecated */
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrdpaddress", MODIFYVM_VRDPADDRESS, RTGETOPT_REQ_STRING }, /* deprecated */
eaae6c3ce81916ccc4e74af4b55972ba956cf5c8vboxsync { "--vrdpauthtype", MODIFYVM_VRDPAUTHTYPE, RTGETOPT_REQ_STRING }, /* deprecated */
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrdpmulticon", MODIFYVM_VRDPMULTICON, RTGETOPT_REQ_BOOL_ONOFF }, /* deprecated */
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrdpreusecon", MODIFYVM_VRDPREUSECON, RTGETOPT_REQ_BOOL_ONOFF }, /* deprecated */
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrdpvideochannel", MODIFYVM_VRDPVIDEOCHANNEL, RTGETOPT_REQ_BOOL_ONOFF }, /* deprecated */
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrdpvideochannelquality", MODIFYVM_VRDPVIDEOCHANNELQUALITY, RTGETOPT_REQ_STRING }, /* deprecated */
eaae6c3ce81916ccc4e74af4b55972ba956cf5c8vboxsync { "--vrdp", MODIFYVM_VRDP, RTGETOPT_REQ_BOOL_ONOFF }, /* deprecated */
cb5363b6fa48f10b080cb6195f56c0823f7c0b0fvboxsync { "--vrdeproperty", MODIFYVM_VRDEPROPERTY, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrdeport", MODIFYVM_VRDEPORT, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrdeaddress", MODIFYVM_VRDEADDRESS, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrdeauthtype", MODIFYVM_VRDEAUTHTYPE, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrdeauthlibrary", MODIFYVM_VRDEAUTHLIBRARY, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrdemulticon", MODIFYVM_VRDEMULTICON, RTGETOPT_REQ_BOOL_ONOFF },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrdereusecon", MODIFYVM_VRDEREUSECON, RTGETOPT_REQ_BOOL_ONOFF },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrdevideochannel", MODIFYVM_VRDEVIDEOCHANNEL, RTGETOPT_REQ_BOOL_ONOFF },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrdevideochannelquality", MODIFYVM_VRDEVIDEOCHANNELQUALITY, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrdeextpack", MODIFYVM_VRDE_EXTPACK, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--vrde", MODIFYVM_VRDE, RTGETOPT_REQ_BOOL_ONOFF },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--usbehci", MODIFYVM_USBEHCI, RTGETOPT_REQ_BOOL_ONOFF },
eaae6c3ce81916ccc4e74af4b55972ba956cf5c8vboxsync { "--usb", MODIFYVM_USB, RTGETOPT_REQ_BOOL_ONOFF },
eaae6c3ce81916ccc4e74af4b55972ba956cf5c8vboxsync { "--snapshotfolder", MODIFYVM_SNAPSHOTFOLDER, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--teleporter", MODIFYVM_TELEPORTER_ENABLED, RTGETOPT_REQ_BOOL_ONOFF },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--teleporterenabled", MODIFYVM_TELEPORTER_ENABLED, RTGETOPT_REQ_BOOL_ONOFF }, /* deprecated */
eaae6c3ce81916ccc4e74af4b55972ba956cf5c8vboxsync { "--teleporterport", MODIFYVM_TELEPORTER_PORT, RTGETOPT_REQ_UINT32 },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--teleporteraddress", MODIFYVM_TELEPORTER_ADDRESS, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--teleporterpassword", MODIFYVM_TELEPORTER_PASSWORD, RTGETOPT_REQ_STRING },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--tracing-enabled", MODIFYVM_TRACING_ENABLED, RTGETOPT_REQ_BOOL_ONOFF },
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync { "--tracing-config", MODIFYVM_TRACING_CONFIG, RTGETOPT_REQ_STRING },
eaae6c3ce81916ccc4e74af4b55972ba956cf5c8vboxsync { "--tracing-allow-vm-access", MODIFYVM_TRACING_ALLOW_VM_ACCESS, RTGETOPT_REQ_BOOL_ONOFF },
cb5363b6fa48f10b080cb6195f56c0823f7c0b0fvboxsync { "--hardwareuuid", MODIFYVM_HARDWARE_UUID, RTGETOPT_REQ_STRING },
cb5363b6fa48f10b080cb6195f56c0823f7c0b0fvboxsync { "--hpet", MODIFYVM_HPET, RTGETOPT_REQ_BOOL_ONOFF },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--iocache", MODIFYVM_IOCACHE, RTGETOPT_REQ_BOOL_ONOFF },
cb5363b6fa48f10b080cb6195f56c0823f7c0b0fvboxsync { "--iocachesize", MODIFYVM_IOCACHESIZE, RTGETOPT_REQ_UINT32 },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--faulttolerance", MODIFYVM_FAULT_TOLERANCE, RTGETOPT_REQ_STRING },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--faulttoleranceaddress", MODIFYVM_FAULT_TOLERANCE_ADDRESS, RTGETOPT_REQ_STRING },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--faulttoleranceport", MODIFYVM_FAULT_TOLERANCE_PORT, RTGETOPT_REQ_UINT32 },
8077a3fb4024022d405598797d3ed75c667a912fvboxsync { "--faulttolerancepassword", MODIFYVM_FAULT_TOLERANCE_PASSWORD, RTGETOPT_REQ_STRING },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--faulttolerancesyncinterval", MODIFYVM_FAULT_TOLERANCE_SYNC_INTERVAL, RTGETOPT_REQ_UINT32 },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--chipset", MODIFYVM_CHIPSET, RTGETOPT_REQ_STRING },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--pciattach", MODIFYVM_ATTACH_PCI, RTGETOPT_REQ_STRING },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync { "--pcidetach", MODIFYVM_DETACH_PCI, RTGETOPT_REQ_STRING },
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsyncstatic void vrdeWarningDeprecatedOption(const char *pszOption)
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync RTStrmPrintf(g_pStdErr, "Warning: '--vrdp%s' is deprecated. Use '--vrde%s'.\n", pszOption, pszOption);
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync/** Parse PCI address in format 01:02.03 and convert it to the numeric representation. */
08870164da59f90379b1ea9b5a2476296c362217vboxsync rc = RTStrToUInt8Ex(pszNext, &pszNext, 16, &aVals[0]);
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync if (RT_FAILURE(rc) || pszNext == NULL || *pszNext != ':')
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync rc = RTStrToUInt8Ex(pszNext+1, &pszNext, 16, &aVals[1]);
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync if (RT_FAILURE(rc) || pszNext == NULL || *pszNext != '.')
a2b66e2b8b92cf2d0706078798036035cb9fa94dvboxsync rc = RTStrToUInt8Ex(pszNext+1, &pszNext, 16, &aVals[2]);
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync return (aVals[0] << 8) | (aVals[1] << 3) | (aVals[2] << 0);
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync /* VM ID + at least one parameter. Parameter arguments are checked
2f8244f574b4b9f99af99b7472984f3e60ea93d0vboxsync * individually. */
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync return errorSyntax(USAGE_MODIFYVM, "Not enough parameters");
2f8244f574b4b9f99af99b7472984f3e60ea93d0vboxsync /* try to find the given machine */
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(),
2f8244f574b4b9f99af99b7472984f3e60ea93d0vboxsync /* Get the number of network adapters */
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync ULONG NetworkAdapterCount = getMaxNics(a->virtualBox, machine);
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync /* open a session for the VM */
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync CHECK_ERROR_RET(machine, LockMachine(a->session, LockType_Write), 1);
2f8244f574b4b9f99af99b7472984f3e60ea93d0vboxsync /* get the mutable session machine */
2f8244f574b4b9f99af99b7472984f3e60ea93d0vboxsync a->session->COMGETTER(Machine)(machine.asOutParam());
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync machine->COMGETTER(BIOSSettings)(biosSettings.asOutParam());
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync RTGetOptInit(&GetOptState, a->argc, a->argv, g_aModifyVMOptions,
2f8244f574b4b9f99af99b7472984f3e60ea93d0vboxsync RT_ELEMENTS(g_aModifyVMOptions), 1, RTGETOPTINIT_FLAGS_NO_STD_OPTS);
c68a3984216eaa85ae7144b3b0d9b168276dbcf3vboxsync CHECK_ERROR(machine, COMSETTER(Name)(Bstr(ValueUnion.psz).raw()));
08870164da59f90379b1ea9b5a2476296c362217vboxsync CHECK_ERROR(a->virtualBox, GetGuestOSType(Bstr(ValueUnion.psz).raw(),
08870164da59f90379b1ea9b5a2476296c362217vboxsync CHECK_ERROR(machine, COMSETTER(OSTypeId)(Bstr(ValueUnion.psz).raw()));
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync errorArgument("Invalid guest OS type '%s'", Utf8Str(ValueUnion.psz).c_str());
2f8244f574b4b9f99af99b7472984f3e60ea93d0vboxsync CHECK_ERROR(machine, COMSETTER(MemorySize)(ValueUnion.u32));
08870164da59f90379b1ea9b5a2476296c362217vboxsync CHECK_ERROR(machine, COMSETTER(PageFusionEnabled)(ValueUnion.f));
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync CHECK_ERROR(machine, COMSETTER(VRAMSize)(ValueUnion.u32));
c68a3984216eaa85ae7144b3b0d9b168276dbcf3vboxsync CHECK_ERROR(machine, COMSETTER(FirmwareType)(FirmwareType_EFI));
c364b6c44a252ab65b514fa8f9a665cc5e33a1cevboxsync CHECK_ERROR(machine, COMSETTER(FirmwareType)(FirmwareType_EFI32));
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync CHECK_ERROR(machine, COMSETTER(FirmwareType)(FirmwareType_EFI64));
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync CHECK_ERROR(machine, COMSETTER(FirmwareType)(FirmwareType_EFIDUAL));
2f8244f574b4b9f99af99b7472984f3e60ea93d0vboxsync CHECK_ERROR(machine, COMSETTER(FirmwareType)(FirmwareType_BIOS));
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync errorArgument("Invalid --firmware argument '%s'", ValueUnion.psz);
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync CHECK_ERROR(biosSettings, COMSETTER(ACPIEnabled)(ValueUnion.f));
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync CHECK_ERROR(biosSettings, COMSETTER(IOAPICEnabled)(ValueUnion.f));
c364b6c44a252ab65b514fa8f9a665cc5e33a1cevboxsync CHECK_ERROR(machine, SetCPUProperty(CPUPropertyType_PAE, ValueUnion.f));
2f8244f574b4b9f99af99b7472984f3e60ea93d0vboxsync CHECK_ERROR(machine, SetCPUProperty(CPUPropertyType_Synthetic, ValueUnion.f));
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_Enabled, ValueUnion.f));
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_Exclusive, ValueUnion.f));
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync for (unsigned i = 0 ; i < 4 ; i++)
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync int vrc = RTGetOptFetchValue(&GetOptState, &ValueUnion, RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_HEX);
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync "Missing or Invalid argument to '%s'",
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync CHECK_ERROR(machine, SetCPUIDLeaf(id, aValue[0], aValue[1], aValue[2], aValue[3]));
a2b66e2b8b92cf2d0706078798036035cb9fa94dvboxsync CHECK_ERROR(machine, RemoveCPUIDLeaf(ValueUnion.u32));
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, ValueUnion.f));
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_LargePages, ValueUnion.f));
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_VPID, ValueUnion.f));
5d1fc7f6c660e826d7f81c580fbf4278dd44c6bdvboxsync CHECK_ERROR(machine, COMSETTER(CPUCount)(ValueUnion.u32));
c364b6c44a252ab65b514fa8f9a665cc5e33a1cevboxsync CHECK_ERROR(machine, COMSETTER(RTCUseUTC)(ValueUnion.f));
f73c807e7ef6a1a6c10ec5cd9b36ee835cfaa241vboxsync CHECK_ERROR(machine, COMSETTER(CPUHotPlugEnabled)(ValueUnion.f));
f73c807e7ef6a1a6c10ec5cd9b36ee835cfaa241vboxsync CHECK_ERROR(machine, HotUnplugCPU(ValueUnion.u32));
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync CHECK_ERROR(machine, COMSETTER(CPUExecutionCap)(ValueUnion.u32));
e75313c24325ec7bec84fa349abb39e246b6cc86vboxsync CHECK_ERROR(machine, COMSETTER(MonitorCount)(ValueUnion.u32));
f73c807e7ef6a1a6c10ec5cd9b36ee835cfaa241vboxsync CHECK_ERROR(machine, COMSETTER(Accelerate3DEnabled)(ValueUnion.f));
f0dd841cb99154da8ec0a31cae2f89044895a23fvboxsync CHECK_ERROR(machine, COMSETTER(Accelerate2DVideoEnabled)(ValueUnion.f));
f0dd841cb99154da8ec0a31cae2f89044895a23fvboxsync CHECK_ERROR(biosSettings, COMSETTER(LogoFadeIn)(ValueUnion.f));
f0dd841cb99154da8ec0a31cae2f89044895a23fvboxsync CHECK_ERROR(biosSettings, COMSETTER(LogoFadeOut)(ValueUnion.f));
f0dd841cb99154da8ec0a31cae2f89044895a23fvboxsync CHECK_ERROR(biosSettings, COMSETTER(LogoDisplayTime)(ValueUnion.u32));
f0dd841cb99154da8ec0a31cae2f89044895a23fvboxsync CHECK_ERROR(biosSettings, COMSETTER(LogoImagePath)(Bstr(ValueUnion.psz).raw()));
f0dd841cb99154da8ec0a31cae2f89044895a23fvboxsync CHECK_ERROR(biosSettings, COMSETTER(BootMenuMode)(BIOSBootMenuMode_Disabled));
f0dd841cb99154da8ec0a31cae2f89044895a23fvboxsync CHECK_ERROR(biosSettings, COMSETTER(BootMenuMode)(BIOSBootMenuMode_MenuOnly));
f0dd841cb99154da8ec0a31cae2f89044895a23fvboxsync else if (!strcmp(ValueUnion.psz, "messageandmenu"))
f0dd841cb99154da8ec0a31cae2f89044895a23fvboxsync CHECK_ERROR(biosSettings, COMSETTER(BootMenuMode)(BIOSBootMenuMode_MessageAndMenu));
f0dd841cb99154da8ec0a31cae2f89044895a23fvboxsync errorArgument("Invalid --biosbootmenu argument '%s'", ValueUnion.psz);
f0dd841cb99154da8ec0a31cae2f89044895a23fvboxsync CHECK_ERROR(biosSettings, COMSETTER(TimeOffset)(ValueUnion.i64));
ff3996360d63d42b188c1696d4760641a7762ce9vboxsync CHECK_ERROR(biosSettings, COMSETTER(PXEDebugEnabled)(ValueUnion.f));
a2b66e2b8b92cf2d0706078798036035cb9fa94dvboxsync CHECK_ERROR(machine, SetBootOrder(GetOptState.uIndex, DeviceType_Null));
c0ae9fb031e70c0e5f4098a46ab11262097c88f9vboxsync CHECK_ERROR(machine, SetBootOrder(GetOptState.uIndex, DeviceType_Floppy));
c0ae9fb031e70c0e5f4098a46ab11262097c88f9vboxsync CHECK_ERROR(machine, SetBootOrder(GetOptState.uIndex, DeviceType_DVD));
c0ae9fb031e70c0e5f4098a46ab11262097c88f9vboxsync CHECK_ERROR(machine, SetBootOrder(GetOptState.uIndex, DeviceType_HardDisk));
c0ae9fb031e70c0e5f4098a46ab11262097c88f9vboxsync CHECK_ERROR(machine, SetBootOrder(GetOptState.uIndex, DeviceType_Network));
2b14f26c96a20e40e9a0c9e3c41b41315f6c6e96vboxsync return errorArgument("Invalid boot device '%s'", ValueUnion.psz);
NULL);
if (hardDisk)
hardDisk));
NULL);
if (hardDisk)
hardDisk);
hardDisk));
if (!dvdMedium)
if (!dvdMedium)
NULL);
if (!dvdMedium)
if (floppyAttachment)
if (!floppyAttachment)
if (!floppyMedium)
NULL);
if (!floppyMedium)
case MODIFYVM_NICTRACEFILE:
case MODIFYVM_NICTRACE:
case MODIFYVM_NICPROPERTY:
if (nic)
if (pszProperty)
if (pDelimiter)
RTStrmPrintf(g_pStdErr, "Error: Failed to allocate memory for --nicproperty%d '%s'\n", GetOptState.uIndex, ValueUnion.psz);
case MODIFYVM_NICTYPE:
#ifdef VBOX_WITH_E1000
#ifdef VBOX_WITH_VIRTIO
case MODIFYVM_NICSPEED:
case MODIFYVM_NICBOOTPRIO:
errorArgument("Invalid boot priority '%u' specfied for NIC %u", ValueUnion.u32, GetOptState.uIndex);
case MODIFYVM_NICPROMISC:
case MODIFYVM_NICBWGROUP:
case MODIFYVM_NIC:
case MODIFYVM_CABLECONNECTED:
case MODIFYVM_BRIDGEADAPTER:
case MODIFYVM_HOSTONLYADAPTER:
case MODIFYVM_INTNET:
case MODIFYVM_GENERICDRV:
case MODIFYVM_NATNET:
case MODIFYVM_NATBINDIP:
if (*ch == 0) \
ch++; \
ch++; \
case MODIFYVM_NATSETTINGS:
char *strMtu;
char *strSockSnd;
char *strSockRcv;
char *strTcpSnd;
char *strTcpRcv;
CHECK_ERROR(driver, SetNetworkSettings(RTStrToUInt32(strMtu), RTStrToUInt32(strSockSnd), RTStrToUInt32(strSockRcv),
case MODIFYVM_NATPF:
char *strName;
char *strProto;
char *strHostIp;
char *strHostPort;
char *strGuestIp;
char *strGuestPort;
int vrc;
case MODIFYVM_NATALIASMODE:
aliasMode = 0;
while(token)
token++;
case MODIFYVM_NATTFTPPREFIX:
case MODIFYVM_NATTFTPFILE:
case MODIFYVM_NATTFTPSERVER:
case MODIFYVM_NATDNSPROXY:
case MODIFYVM_MACADDRESS:
case MODIFYVM_HIDPTR:
bool fEnableUsb = false;
fEnableUsb = true;
fEnableUsb = true;
if (fEnableUsb)
fEnabled = false;
if (!fEnabled)
case MODIFYVM_HIDKBD:
bool fEnableUsb = false;
fEnableUsb = true;
if (fEnableUsb)
fEnabled = false;
if (!fEnabled)
case MODIFYVM_UARTMODE:
case MODIFYVM_UART:
case MODIFYVM_LPTMODE:
case MODIFYVM_LPT:
case MODIFYVM_AUDIOCONTROLLER:
case MODIFYVM_AUDIO:
#ifdef RT_OS_WINDOWS
#ifdef VBOX_WITH_WINMM
#ifdef RT_OS_LINUX
# ifdef VBOX_WITH_ALSA
# ifdef VBOX_WITH_PULSE
#ifdef RT_OS_SOLARIS
#ifdef RT_OS_FREEBSD
# ifdef VBOX_WITH_PULSE
#ifdef RT_OS_DARWIN
case MODIFYVM_CLIPBOARD:
case MODIFYVM_VRDE_EXTPACK:
if (vrdeServer)
case MODIFYVM_VRDEPROPERTY:
if (vrdeServer)
if (pszProperty)
if (pDelimiter)
RTStrmPrintf(g_pStdErr, "Error: Failed to allocate memory for VRDE property '%s'\n", ValueUnion.psz);
case MODIFYVM_VRDPPORT:
case MODIFYVM_VRDEPORT:
case MODIFYVM_VRDPADDRESS:
case MODIFYVM_VRDEADDRESS:
case MODIFYVM_VRDPAUTHTYPE:
case MODIFYVM_VRDEAUTHTYPE:
case MODIFYVM_VRDEAUTHLIBRARY:
if (vrdeServer)
case MODIFYVM_VRDPMULTICON:
case MODIFYVM_VRDEMULTICON:
case MODIFYVM_VRDPREUSECON:
case MODIFYVM_VRDEREUSECON:
case MODIFYVM_VRDP:
case MODIFYVM_VRDE:
case MODIFYVM_USBEHCI:
case MODIFYVM_USB:
case MODIFYVM_SNAPSHOTFOLDER:
case MODIFYVM_TELEPORTER_PORT:
case MODIFYVM_TRACING_ENABLED:
case MODIFYVM_TRACING_CONFIG:
case MODIFYVM_FAULT_TOLERANCE:
case MODIFYVM_HARDWARE_UUID:
case MODIFYVM_HPET:
case MODIFYVM_IOCACHE:
case MODIFYVM_IOCACHESIZE:
case MODIFYVM_CHIPSET:
if (!fIoApic)
#ifdef VBOX_WITH_PCI_PASSTHROUGH
case MODIFYVM_ATTACH_PCI:
errorArgument("Invalid --pciattach argument '%s' (valid: 'HB:HD.HF@GB:GD.GF' or just 'HB:HD.HF')", ValueUnion.psz);
case MODIFYVM_DETACH_PCI: