VBoxManage.cpp revision fd1c6920c47aa3e43853f6152b9502d68a0a4f66
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync * VBox frontends: VBoxManage (command-line interface)
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * VBoxManage is VirtualBox's command-line interface. This is its rather
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * long source.
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * Copyright (C) 2006-2007 innotek GmbH
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * available from http://www.virtualbox.org. This file is free software;
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * you can redistribute it and/or modify it under the terms of the GNU
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * General Public License as published by the Free Software Foundation,
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * distribution. VirtualBox OSE is distributed in the hope that it will
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync * be useful, but WITHOUT ANY WARRANTY of any kind.
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync/*******************************************************************************
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync* Header Files *
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync*******************************************************************************/
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsyncusing namespace com;
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync/* missing XPCOM <-> COM wrappers */
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync# define STDMETHOD_(ret, meth) NS_IMETHOD_(ret) meth
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync/** command handler type */
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsynctypedef DECLCALLBACK(int) FNHANDLER(int argc, char *argv[], ComPtr<IVirtualBox> aVirtualBox, ComPtr<ISession> aSession);
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync * Quick IUSBDevice implementation for detaching / attaching
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync * devices to the USB Controller.
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync // public initializer/uninitializer for internal purposes only
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync MyUSBDevice(uint16_t a_u16VendorId, uint16_t a_u16ProductId, uint16_t a_bcdRevision, uint64_t a_u64SerialHash, const char *a_pszComment)
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync : m_usVendorId(a_u16VendorId), m_usProductId(a_u16ProductId),
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync m_bcdRevision(a_bcdRevision), m_u64SerialHash(a_u64SerialHash),
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync delete this;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(QueryInterface)(const IID &iid, void **ppvObject)
0c94a8282c9042b02f022302a3d987746140eab9vboxsync STDMETHOD(COMGETTER(Id))(GUIDPARAMOUT a_pId) { return E_NOTIMPL; }
0c94a8282c9042b02f022302a3d987746140eab9vboxsync STDMETHOD(COMGETTER(VendorId))(USHORT *a_pusVendorId) { *a_pusVendorId = m_usVendorId; return S_OK; }
0c94a8282c9042b02f022302a3d987746140eab9vboxsync STDMETHOD(COMGETTER(ProductId))(USHORT *a_pusProductId) { *a_pusProductId = m_usProductId; return S_OK; }
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(Revision))(USHORT *a_pusRevision) { *a_pusRevision = m_bcdRevision; return S_OK; }
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(SerialHash))(ULONG64 *a_pullSerialHash) { *a_pullSerialHash = m_u64SerialHash; return S_OK; }
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(Manufacturer))(BSTR *a_pManufacturer) { return E_NOTIMPL; }
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync STDMETHOD(COMGETTER(Product))(BSTR *a_pProduct) { return E_NOTIMPL; }
0c94a8282c9042b02f022302a3d987746140eab9vboxsync STDMETHOD(COMGETTER(SerialNumber))(BSTR *a_pSerialNumber) { return E_NOTIMPL; }
0c94a8282c9042b02f022302a3d987746140eab9vboxsync STDMETHOD(COMGETTER(Address))(BSTR *a_pAddress) { return E_NOTIMPL; }
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /** The vendor id of this USB device. */
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync /** The product id of this USB device. */
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync /** The product revision number of this USB device.
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync * (high byte = integer; low byte = decimal) */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /** The USB serial hash of the device. */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /** The user comment string. */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /** Reference counter. */
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync///////////////////////////////////////////////////////////////////////////////
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsynctemplate <typename T>
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync void setNull (bool aIsNull = true) { mIsNull = aIsNull; }
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync operator const T&() const { return mValue; }
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync return *this;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync/** helper structure to encapsulate USB filter manipulation commands */
82e3a4017d20f44c30ff909e6b825ff78139cbbbvboxsync : mAction (USBDeviceFilterAction_InvalidUSBDeviceFilterAction)
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync USBFilterCmd() : mAction (Invalid), mIndex (0), mGlobal (false) {}
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /** flag whether the command target is a global filter */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /** machine this command is targeted at (null for global filters) */
0c94a8282c9042b02f022302a3d987746140eab9vboxsync///////////////////////////////////////////////////////////////////////////////
0c94a8282c9042b02f022302a3d987746140eab9vboxsyncstatic void showLogo(void)
0c94a8282c9042b02f022302a3d987746140eab9vboxsync RTPrintf("VirtualBox Command Line Management Interface Version "
0c94a8282c9042b02f022302a3d987746140eab9vboxsync "(C) 2005-2007 innotek GmbH\n"
0c94a8282c9042b02f022302a3d987746140eab9vboxsync "All rights reserved.\n"
0c94a8282c9042b02f022302a3d987746140eab9vboxsync bool fLinux = true;
0c94a8282c9042b02f022302a3d987746140eab9vboxsync bool fLinux = false;
0c94a8282c9042b02f022302a3d987746140eab9vboxsync bool fWin = true;
0c94a8282c9042b02f022302a3d987746140eab9vboxsync bool fWin = false;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync bool fDarwin = true;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync bool fDarwin = false;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync bool fVRDP = true;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync bool fVRDP = false;
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync RTPrintf("VBoxManage [-v|-version] print version number and exit\n");
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync RTPrintf("VBoxManage -nologo ... suppress the logo\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync RTPrintf("VBoxManage list vms|ostypes|hostdvds|hostfloppies|");
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " hdds|dvds|floppies|usbhost|usbfilters|\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " systemproperties\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-details]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-statistics]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-machinereadable]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-delete]\n"
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync " [-register]\n"
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync " [-basefolder <path> | -settingsfile <path>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-name <name>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-ostype <ostype>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-memory <memorysize>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-vram <vramsize>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-acpi on|off]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-ioapic on|off]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-hwvirtex on|off|default]\n"
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync " [-monitorcount <number>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-bioslogofadein on|off]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-bioslogofadeout on|off]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-bioslogodisplaytime <msec>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-bioslogoimagepath <imagepath>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-biosbootmenu disabled|menuonly|messageandmenu]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-biossystemtimeoffset <msec>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-biospxedebug on|off]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-boot<1-4> none|floppy|dvd|disk|net>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-hd<a|b|d> none|<uuid>|<filename>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-dvd none|<uuid>|<filename>|host:<drive>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-dvdpassthrough on|off]\n"
38745c55f37c31ba8b78cc728d2f08ea6eec38d6vboxsync " [-floppy disabled|empty|<uuid>|\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " <filename>|host:<drive>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-nic<1-N> none|null|nat|hostif|intnet]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-nictype<1-N> Am79C970A|Am79C973]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-cableconnected<1-N> on|off]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-nictrace<1-N> on|off]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-nictracefile<1-N> <filename>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-nicspeed<1-N> <kbps>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-hostifdev<1-N> none|<devicename>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-intnet<1-N> <network>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-macaddress<1-N> auto|<mac>]\n"
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync " [-uart<1-N> off|<I/O base> <IRQ>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-uartmode<1-N> disconnected|\n"
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync " server <pipe>|\n"
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync " client <pipe>|\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " <devicename>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-guestmemoryballoon <balloonsize>]\n"
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync " [-gueststatisticsinterval <seconds>]\n"
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync " [-tapterminate<1-N> none|<application>]\n");
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf(" [-clipboard disabled|hosttoguest|guesttohost|\n"
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync " bidirectional]\n");
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync " [-vrdpport default|<port>]\n"
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync " [-vrdpaddress <host>]\n"
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync " [-vrdpauthtype null|external|guest]\n"
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync " [-vrdpmulticon on|off]\n");
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync " [-snapshotfolder default|<path>]\n"
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync " [-type gui|vrdp]\n"
0c94a8282c9042b02f022302a3d987746140eab9vboxsync " pause|resume|reset|poweroff|savestate|\n"
0c94a8282c9042b02f022302a3d987746140eab9vboxsync " acpipowerbutton |\n"
0c94a8282c9042b02f022302a3d987746140eab9vboxsync " setlinkstate<1-4> on|off |\n"
0c94a8282c9042b02f022302a3d987746140eab9vboxsync " usbattach <uuid>|<address> |\n"
0c94a8282c9042b02f022302a3d987746140eab9vboxsync " usbdetach <uuid>|<address> |\n"
0c94a8282c9042b02f022302a3d987746140eab9vboxsync " dvdattach none|<uuid>|<filename>|host:<drive> |\n"
0c94a8282c9042b02f022302a3d987746140eab9vboxsync " floppyattach none|<uuid>|<filename>|host:<drive> |\n"
0c94a8282c9042b02f022302a3d987746140eab9vboxsync " setvideomodehint <xres> <yres> <bpp> [display]|\n"
38745c55f37c31ba8b78cc728d2f08ea6eec38d6vboxsync " setcredentials <username> <password> <domain>\n"
0c94a8282c9042b02f022302a3d987746140eab9vboxsync " [-allowlocallogon <yes|no>]\n"
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync " take <name> [-desc <desc>] |\n"
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync " discard <uuid>|<name> |\n"
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync " discardcurrent -state|-all |\n"
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync " edit <uuid>|<name>|-current\n"
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync " [-newname <name>]\n"
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync " [-newdesc <desc>] |\n"
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync " showvminfo <uuid>|<name>\n"
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("VBoxManage registerimage disk|dvd|floppy <filename>\n"
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync " [-type normal|immutable|writethrough] (disk only)\n"
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync RTPrintf("VBoxManage unregisterimage disk|dvd|floppy <uuid>|<filename>\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync RTPrintf("VBoxManage showvdiinfo <uuid>|<filename>\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync RTPrintf("VBoxManage createvdi -filename <filename>\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " -size <megabytes>\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync " [-static]\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync " [-comment <comment>]\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync " [-register]\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync " [-type normal|writethrough] (default: normal)\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync RTPrintf("VBoxManage modifyvdi <uuid>|<filename>\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync#if 0 /* doesn't currently work */
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync " settype normal|writethrough|immutable |\n"
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync " compact\n"
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync RTPrintf("VBoxManage clonevdi <uuid>|<filename> <outputfile>\n"
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync RTPrintf("VBoxManage convertdd <filename> <outputfile>\n"
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync "VBoxManage convertdd stdin <outputfile> <bytes>\n"
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync RTPrintf("VBoxManage addiscsidisk -server <name>|<ip>\n"
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync " -target <target>\n"
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync " [-port <port>]\n"
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync " [-lun <lun>]\n"
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync " [-encodedlun <lun>]\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync " [-username <username>]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " [-password <password>]\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync " [-comment <comment>]\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync RTPrintf("VBoxManage getextradata global|<uuid>|<name>\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " <key>|enumerate\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync RTPrintf("VBoxManage setextradata global|<uuid>|<name>\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync " [<value>] (no value deletes key)\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync RTPrintf("VBoxManage setproperty vdifolder default|<folder> |\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync " machinefolder default|<folder> |\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync " vrdpauthlibrary default|<library> |\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " hwvirtexenabled yes|no\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync " loghistorycount <value>\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " -target <uuid>|<name>|global\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " -name <string>\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " -action ignore|hold (global filters only)\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " [-active yes|no] (yes)\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " [-vendorid <XXXX>] (null)\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " [-productid <XXXX>] (null)\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync " [-revision <IIFF>] (null)\n"
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync " [-manufacturer <string>] (null)\n"
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync " [-product <string>] (null)\n"
82e3a4017d20f44c30ff909e6b825ff78139cbbbvboxsync " [-remote yes|no] (null, VM filters only)\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " [-serialnumber <string>] (null)\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync RTPrintf("VBoxManage usbfilter modify <index,0-N>\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " -target <uuid>|<name>|global\n"
82e3a4017d20f44c30ff909e6b825ff78139cbbbvboxsync " [-name <string>]\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync " [-action ignore|hold] (global filters only)\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " [-active yes|no]\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " [-vendorid <XXXX>|\"\"]\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " [-productid <XXXX>|\"\"]\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " [-revision <IIFF>|\"\"]\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " [-manufacturer <string>|\"\"]\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " [-product <string>|\"\"]\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync " [-remote yes|no] (null, VM filters only)\n"
82e3a4017d20f44c30ff909e6b825ff78139cbbbvboxsync " [-serialnumber <string>|\"\"]\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync RTPrintf("VBoxManage usbfilter remove <index,0-N>\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync " -target <uuid>|<name>|global\n"
a66ec044d2a64d926996cd24da5faadccb070be3vboxsync RTPrintf("VBoxManage sharedfolder add <vmname>|<uuid>\n"
a66ec044d2a64d926996cd24da5faadccb070be3vboxsync " -name <name> -hostpath <hostpath>\n"
a66ec044d2a64d926996cd24da5faadccb070be3vboxsync " [-transient]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync RTPrintf("VBoxManage sharedfolder remove <vmname>|<uuid>\n"
0c94a8282c9042b02f022302a3d987746140eab9vboxsync " -name <name> [-transient]\n"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync RTPrintf("VBoxManage updatesettings [<dir>|<file>] [-apply]\n"
0c94a8282c9042b02f022302a3d987746140eab9vboxsync " [-nobackup] [-skipinvalid]\n"
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync RTPrintf("VBoxManage vmstatistics <vmname>|<uuid>\n"
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync " [-pattern <pattern>] [-descriptions]\n"
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync * Print a usage synopsis and the syntax error message.
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsyncint errorSyntax(USAGECATEGORY u64Cmd, const char *pszFormat, ...)
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * Print an error message without the syntax stuff.
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * Print out progress on the console
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsyncstatic void showProgress(ComPtr<IProgress> progress)
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync while (SUCCEEDED(progress->COMGETTER(Completed(&fCompleted))))
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /* did we cross a 10% mark? */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /* make sure to also print out missed steps */
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync for (LONG curVal = (lastPercent / 10) * 10 + 10; curVal <= (currentPercent / 10) * 10; curVal += 10)
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync /* make sure the loop is not too tight */
66b58af085e22ee26be57f98127fb49ee2e91790vboxsyncstatic void showSnapshots(ComPtr<ISnapshot> rootSnapshot, VMINFO_DETAILS details, const Bstr &prefix = "", int level = 0)
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /* start with the root */
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync /* print with hierarchical numbering */
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync RTPrintf("SnapshotName%lS=\"%lS\"\n", prefix.raw(), name.raw());
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync RTPrintf("SnapshotUUID%lS=\"%s\"\n", prefix.raw(), uuid.toString().raw());
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync /* print with indentation */
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync RTPrintf(" %lSName: %lS (UUID: %s)\n", prefix.raw(), name.raw(), uuid.toString().raw());
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync /* get the children */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync rootSnapshot->COMGETTER(Children)(coll.asOutParam());
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync newPrefix = Utf8StrFmt("%lS-%d", prefix.raw(), index + 1);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync /* recursive call */
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync showSnapshots(snapshot, details, newPrefix, level + 1);
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsyncstatic void makeTimeStr (char *s, int cb, int64_t millies)
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync RTStrPrintf(s, cb, "%04d/%02d/%02d %02d:%02d:%02d UTC",
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsyncstatic HRESULT showVMInfo (ComPtr <IVirtualBox> virtualBox, ComPtr<IMachine> machine,
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * The rules for output in -argdump format:
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * 1) the key part (the [0-9a-zA-Z_]+ string before the '=' delimiter)
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync * is all lowercase for "VBoxManage modifyvm" parameters. Any
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * other values printed are in CamelCase.
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * 2) strings (anything non-decimal) are printed surrounded by
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync * double quotes '"'. If the strings themselves contain double
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync * quotes, these characters are escaped by '\'. Any '\' character
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync * in the original string is also escaped by '\'.
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync * 3) numbers (containing just [0-9\-]) are written out unchanged.
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync /** @todo the quoting is not yet implemented! */
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync CHECK_ERROR (machine, COMGETTER(Accessible) (&accessible));
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync rc = machine->COMGETTER(SettingsFilePath) (settingsFilePath.asOutParam());
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync RTPrintf ("Config file: %lS\n", settingsFilePath.raw());
23d8f7aff045c2bade1b168fee79a3e4749e2345vboxsync rc = machine->COMGETTER(AccessError) (accessError.asOutParam());
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync rc = machine->COMGETTER(Name)(machineName.asOutParam());
76f3a3817b6b96f5beb30b76efebdf2d87090cf0vboxsync rc = machine->COMGETTER(OSTypeId)(osTypeId.asOutParam());
9b1d52365befbce1af8f32d53c2e563ee9169501vboxsync rc = virtualBox->GetGuestOSType (osTypeId, osType.asOutParam());
76f3a3817b6b96f5beb30b76efebdf2d87090cf0vboxsync rc = osType->COMGETTER(Description)(osName.asOutParam());
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync rc = machine->COMGETTER(SettingsFilePath)(settingsFilePath.asOutParam());
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync RTPrintf("CfgFile=\"%lS\"\n", settingsFilePath.raw());
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync RTPrintf("Config file: %lS\n", settingsFilePath.raw());
8865793e4f3435f5e2c728d9e6739cd24d08c0devboxsync machine->COMGETTER(BIOSSettings)(biosSettings.asOutParam());
76f3a3817b6b96f5beb30b76efebdf2d87090cf0vboxsync biosSettings->COMGETTER(BootMenuMode)(&bootMenuMode);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync biosSettings->COMGETTER(ACPIEnabled)(&acpiEnabled);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("acpi=\"%s\"\n", acpiEnabled ? "on" : "off");
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("ACPI: %s\n", acpiEnabled ? "on" : "off");
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync biosSettings->COMGETTER(IOAPICEnabled)(&ioapicEnabled);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("ioapic=\"%s\"\n", ioapicEnabled ? "on" : "off");
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("IOAPIC: %s\n", ioapicEnabled ? "on" : "off");
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("biossystemtimeoffset=%lld\n", timeOffset);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync machine->COMGETTER(HWVirtExEnabled)(&hwVirtExEnabled);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam());
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync systemProperties->COMGETTER(HWVirtExEnabled)(&fHWVirtExEnabled);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync RTPrintf("Hardw. virt.ext: Default (%s)\n", fHWVirtExEnabled ? "on" : "off");
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync RTPrintf("hwvirtex=\"%s\"\n", hwVirtExEnabled == TriStateBool_True ? "on" : "off");
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync RTPrintf("Hardw. virt.ext: %s\n", hwVirtExEnabled == TriStateBool_True ? "on" : "off");
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync RTPrintf("State: %s (since %s)\n", pszState, pszTime);
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync rc = machine->COMGETTER(FloppyDrive)(floppyDrive.asOutParam());
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync rc = floppyDrive->GetImage(floppyImage.asOutParam());
2d66abeefb9716ed570bb5714884d3fe08629452vboxsync floppyImage->COMGETTER(FilePath)(imagePath.asOutParam());
2d66abeefb9716ed570bb5714884d3fe08629452vboxsync floppyImage->COMGETTER(Id)(imageGuid.asOutParam());
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync RTPrintf("FloppyImageUUID=\"%s\"\n", imageGuid.toString().raw());
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync pszFloppy = Utf8StrFmt("%lS (UUID: %s)", imagePath.raw(), imageGuid.toString().raw());
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync rc = floppyDrive->GetHostDrive(hostFloppyDrive.asOutParam());
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync hostFloppyDrive->COMGETTER(Name)(driveName.asOutParam());
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync pszFloppy = Utf8StrFmt("host:%lS", driveName.raw());
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync pszFloppy = Utf8StrFmt("Host drive %lS", driveName.raw());
20f21077abf35d7b7b618acb159267933907407fvboxsync rc = machine->GetHardDisk(DiskControllerType_IDE0Controller, 0, hardDisk.asOutParam());
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync /// @todo (dmik) we temporarily use the location property to
20f21077abf35d7b7b618acb159267933907407fvboxsync // determine the image file name. This is subject to change
20f21077abf35d7b7b618acb159267933907407fvboxsync // when iSCSI disks are here (we should either query a
20f21077abf35d7b7b618acb159267933907407fvboxsync // storage-specific interface from IHardDisk, or "standardize"
20f21077abf35d7b7b618acb159267933907407fvboxsync // the location property)
20f21077abf35d7b7b618acb159267933907407fvboxsync hardDisk->COMGETTER(Location)(filePath.asOutParam());
c66c4413faa5a72ce047742f9acfa85e94dec8afvboxsync RTPrintf("HdaImageUUID=\"%s\"\n", uuid.toString().raw());
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync RTPrintf("Primary master: %lS (UUID: %s)\n", filePath.raw(), uuid.toString().raw());
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync rc = machine->GetHardDisk(DiskControllerType_IDE0Controller, 1, hardDisk.asOutParam());
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync /// @todo (dmik) we temporarily use the location property to
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync // determine the image file name. This is subject to change
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync // when iSCSI disks are here (we should either query a
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync // storage-specific interface from IHardDisk, or "standardize"
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync // the location property)
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync hardDisk->COMGETTER(Location)(filePath.asOutParam());
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync RTPrintf("HdbImageUUID=\"%s\"\n", uuid.toString().raw());
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync RTPrintf("Primary slave: %lS (UUID: %s)\n", filePath.raw(), uuid.toString().raw());
661bfa5aae55ac2f94fa1cb131ea2323e5f6e633vboxsync rc = machine->GetHardDisk(DiskControllerType_IDE1Controller, 1, hardDisk.asOutParam());
66b58af085e22ee26be57f98127fb49ee2e91790vboxsync /// @todo (dmik) we temporarily use the location property to
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync // determine the image file name. This is subject to change
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync // when iSCSI disks are here (we should either query a
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync // storage-specific interface from IHardDisk, or "standardize"
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync // the location property)
56970d3a1944c7c073d66266cd52449835221badvboxsync hardDisk->COMGETTER(Location)(filePath.asOutParam());
56970d3a1944c7c073d66266cd52449835221badvboxsync RTPrintf("HddImageUUID=\"%s\"\n", uuid.toString().raw());
56970d3a1944c7c073d66266cd52449835221badvboxsync RTPrintf("Secondary slave: %lS (UUID: %s)\n", filePath.raw(), uuid.toString().raw());
56970d3a1944c7c073d66266cd52449835221badvboxsync rc = machine->COMGETTER(DVDDrive)(dvdDrive.asOutParam());
56970d3a1944c7c073d66266cd52449835221badvboxsync rc = dvdImage->COMGETTER(FilePath)(filePath.asOutParam());
56970d3a1944c7c073d66266cd52449835221badvboxsync RTPrintf("DvdImageUUID=\"%s\"\n", uuid.toString().raw());
56970d3a1944c7c073d66266cd52449835221badvboxsync RTPrintf("DVD: %lS (UUID: %s)\n", filePath.raw(), uuid.toString().raw());
56970d3a1944c7c073d66266cd52449835221badvboxsync rc = dvdDrive->GetHostDrive(hostDVDDrive.asOutParam());
56970d3a1944c7c073d66266cd52449835221badvboxsync RTPrintf("dvdpassthrough=\"%s\"\n", fPassthrough ? "on" : "off");
56970d3a1944c7c073d66266cd52449835221badvboxsync /* get the maximum amount of NICS */
56970d3a1944c7c073d66266cd52449835221badvboxsync virtualBox->COMGETTER(SystemProperties)(sysProps.asOutParam());
56970d3a1944c7c073d66266cd52449835221badvboxsync sysProps->COMGETTER(NetworkAdapterCount)(&maxNICs);
56970d3a1944c7c073d66266cd52449835221badvboxsync for (ULONG currentNIC = 0; currentNIC < maxNICs; currentNIC++)
56970d3a1944c7c073d66266cd52449835221badvboxsync rc = machine->GetNetworkAdapter(currentNIC, nic.asOutParam());
56970d3a1944c7c073d66266cd52449835221badvboxsync nic->COMGETTER(MACAddress)(strMACAddress.asOutParam());
56970d3a1944c7c073d66266cd52449835221badvboxsync case NetworkAttachmentType_HostInterfaceNetworkAttachment:
56970d3a1944c7c073d66266cd52449835221badvboxsync nic->COMGETTER(HostInterface)(strHostIfDev.asOutParam());
56970d3a1944c7c073d66266cd52449835221badvboxsync RTPrintf("hostifdev%d=\"%lS\"\n", currentNIC + 1, strHostIfDev.raw());
56970d3a1944c7c073d66266cd52449835221badvboxsync strAttachment = Utf8StrFmt("Host Interface '%lS'", strHostIfDev.raw());
56970d3a1944c7c073d66266cd52449835221badvboxsync case NetworkAttachmentType_InternalNetworkAttachment:
56970d3a1944c7c073d66266cd52449835221badvboxsync nic->COMGETTER(InternalNetwork)(strNetwork.asOutParam());
56970d3a1944c7c073d66266cd52449835221badvboxsync RTPrintf("intnet%d=\"%lS\"\n", currentNIC + 1, strNetwork.raw());
56970d3a1944c7c073d66266cd52449835221badvboxsync strAttachment = Utf8StrFmt("Internal Network '%s'", Utf8Str(strNetwork).raw());
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /* cable connected */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /* trace stuff */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /* NIC type */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /* reported line speed */
49a6b09abb20015b0af3e618a1f92b7e26785e90vboxsync RTPrintf("macaddress%d=\"%lS\"\n", currentNIC + 1, strMACAddress.raw());
49a6b09abb20015b0af3e618a1f92b7e26785e90vboxsync RTPrintf("cableconnected%d=\"%s\"\n", currentNIC + 1, fConnected ? "on" : "off");
49a6b09abb20015b0af3e618a1f92b7e26785e90vboxsync RTPrintf("nic%d=\"%s\"\n", currentNIC + 1, strAttachment.raw());
49a6b09abb20015b0af3e618a1f92b7e26785e90vboxsync RTPrintf("NIC %d: MAC: %lS, Attachment: %s, Cable connected: %s, Trace: %s (file: %lS), Type: %s, Reported speed: %d Mbps\n",
49a6b09abb20015b0af3e618a1f92b7e26785e90vboxsync currentNIC + 1, strMACAddress.raw(), strAttachment.raw(),
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /* get the maximum amount of UARTs */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync for (ULONG currentUART = 0; currentUART < maxUARTs; currentUART++)
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = machine->GetSerialPort(currentUART, uart.asOutParam());
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("uartmode%d=\"disconnected\"\n", currentUART + 1);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("uartmode%d=\"%s,%lS\"\n", currentUART + 1,
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf(", attached to device '%lS'\n", path.raw());
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = machine->COMGETTER(AudioAdapter)(AudioAdapter.asOutParam());
49a6b09abb20015b0af3e618a1f92b7e26785e90vboxsync rc = AudioAdapter->COMGETTER(AudioDriver)(&enmType);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("Audio: %s (Driver: %s)\n", fEnabled ? "enabled" : "disabled", psz);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync /* Shared clipboard */
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET(console, COMGETTER(Display)(display.asOutParam()), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET(display, COMGETTER(Width)(&xRes), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET(display, COMGETTER(Height)(&yRes), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET(display, COMGETTER(BitsPerPixel)(&bpp), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("VideoMode=\"%d,%d,%d\"\n", xRes, yRes, bpp);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("Video mode: %dx%dx%d\n", xRes, yRes, bpp);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync rc = machine->COMGETTER(VRDPServer)(vrdpServer.asOutParam());
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync vrdpServer->COMGETTER(NetAddress)(address.asOutParam());
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync vrdpServer->COMGETTER(AllowMultiConnection)(&fMultiCon);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("vrdpmulticon=\"%s\"\n", fMultiCon ? "on" : "off");
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("VRDP: enabled (Address %lS, Port %d, MultiConn: %s, Authentication type: %s)\n", address.raw(), port, fMultiCon ? "on" : "off", strAuthType);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync rc = machine->COMGETTER(USBController)(USBCtl.asOutParam());
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("USB: %s\n", fEnabled ? "enabled" : "disabled");
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET (USBCtl, COMGETTER(DeviceFilters)(Coll.asOutParam()), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET (Coll, Enumerate(Enum.asOutParam()), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync /* Query info. */
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET (DevPtr, COMGETTER (Active) (&bActive), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("USBFilterActive%d=\"%s\"\n", index + 1, bActive ? "on" : "off");
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET (DevPtr, COMGETTER (Name) (bstr.asOutParam()), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("USBFilterName%d=\"%lS\"\n", index + 1, bstr.raw());
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET (DevPtr, COMGETTER (VendorId) (bstr.asOutParam()), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("USBFilterVendorId%d=\"%lS\"\n", index + 1, bstr.raw());
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET (DevPtr, COMGETTER (ProductId) (bstr.asOutParam()), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("USBFilterProductId%d=\"%lS\"\n", index + 1, bstr.raw());
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET (DevPtr, COMGETTER (Revision) (bstr.asOutParam()), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("USBFilterRevision%d=\"%lS\"\n", index + 1, bstr.raw());
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET (DevPtr, COMGETTER (Manufacturer) (bstr.asOutParam()), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("USBFilterManufacturer%d=\"%lS\"\n", index + 1, bstr.raw());
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET (DevPtr, COMGETTER (Product) (bstr.asOutParam()), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("USBFilterProduct%d=\"%lS\"\n", index + 1, bstr.raw());
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET (DevPtr, COMGETTER (Remote) (bstr.asOutParam()), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("USBFilterRemote%d=\"%lS\"\n", index + 1, bstr.raw());
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET (DevPtr, COMGETTER (SerialNumber) (bstr.asOutParam()), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("USBFilterSerialNumber%d=\"%lS\"\n", index + 1, bstr.raw());
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync /* scope */
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET (console, COMGETTER(RemoteUSBDevices) (coll.asOutParam()), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET (coll, Enumerate (en.asOutParam()), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync /* Query info. */
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET (dev, COMGETTER(Id)(id.asOutParam()), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET (dev, COMGETTER(VendorId)(&usVendorId), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET (dev, COMGETTER(ProductId)(&usProductId), rc);
f40cc8247b1da75ce42e73e6c557ec29b8f830a5vboxsync CHECK_ERROR_RET (dev, COMGETTER(Revision)(&bcdRevision), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync "USBRemoteVendorId%d=\"%#06x\"\n"
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync "USBRemoteProductId%d=\"%#06x\"\n"
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync "USBRemoteRevision%d=\"%#04x%02x\"\n",
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync "VendorId: 0x%04x (%04X)\n"
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync "ProductId: 0x%04x (%04X)\n"
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync "Revision: %u.%u (%02u%02u)\n",
f40cc8247b1da75ce42e73e6c557ec29b8f830a5vboxsync /* optional stuff. */
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET (dev, COMGETTER(Manufacturer)(bstr.asOutParam()), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync RTPrintf("USBRemoteManufacturer%d=\"%lS\"\n", index + 1, bstr.raw());
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET (dev, COMGETTER(Product)(bstr.asOutParam()), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync RTPrintf("USBRemoteProduct%d=\"%lS\"\n", index + 1, bstr.raw());
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET (dev, COMGETTER(SerialNumber)(bstr.asOutParam()), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync RTPrintf("USBRemoteSerialNumber%d=\"%lS\"\n", index + 1, bstr.raw());
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET (dev, COMGETTER(Address)(bstr.asOutParam()), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync RTPrintf("USBRemoteAddress%d=\"%lS\"\n", index + 1, bstr.raw());
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync /* scope */
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET (console, COMGETTER(USBDevices) (coll.asOutParam()), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET (coll, Enumerate (en.asOutParam()), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync /* Query info. */
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET (dev, COMGETTER(Id)(id.asOutParam()), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET (dev, COMGETTER(VendorId)(&usVendorId), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET (dev, COMGETTER(ProductId)(&usProductId), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET (dev, COMGETTER(Revision)(&bcdRevision), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync "USBAttachedVendorId%d=\"%#06x\"\n"
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync "USBAttachedProductId%d=\"%#06x\"\n"
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync "USBAttachedRevision%d=\"%#04x%02x\"\n",
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync "VendorId: 0x%04x (%04X)\n"
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync "ProductId: 0x%04x (%04X)\n"
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync "Revision: %u.%u (%02u%02u)\n",
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync /* optional stuff. */
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync CHECK_ERROR_RET (dev, COMGETTER(Manufacturer)(bstr.asOutParam()), rc);
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync RTPrintf("USBAttachedManufacturer%d=\"%lS\"\n", index + 1, bstr.raw());
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync CHECK_ERROR_RET (dev, COMGETTER(Product)(bstr.asOutParam()), rc);
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync RTPrintf("USBAttachedProduct%d=\"%lS\"\n", index + 1, bstr.raw());
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync CHECK_ERROR_RET (dev, COMGETTER(SerialNumber)(bstr.asOutParam()), rc);
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync RTPrintf("USBAttachedSerialNumber%d=\"%lS\"\n", index + 1, bstr.raw());
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync CHECK_ERROR_RET (dev, COMGETTER(Address)(bstr.asOutParam()), rc);
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync RTPrintf("USBAttachedAddress%d=\"%lS\"\n", index + 1, bstr.raw());
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync } /* USB */
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync * Shared folders
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync#if 0 // not yet implemented
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync /* globally shared folders first */
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync CHECK_ERROR_RET(virtualBox, COMGETTER(SharedFolders)(sfColl.asOutParam()), rc);
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync CHECK_ERROR_RET(sfColl, Enumerate(sfEnum.asOutParam()), rc);
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync CHECK_ERROR_RET(sfEnum, GetNext(sf.asOutParam()), rc);
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync RTPrintf("Name: '%lS', Host path: '%lS' (global mapping)\n", name.raw(), hostPath.raw());
8f7ee9e453c60b3b699799538a45950b35266665vboxsync /* now VM mappings */
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync CHECK_ERROR_RET(machine, COMGETTER(SharedFolders)(sfColl.asOutParam()), rc);
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync CHECK_ERROR_RET(sfColl, Enumerate(sfEnum.asOutParam()), rc);
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync CHECK_ERROR_RET(sfEnum, GetNext(sf.asOutParam()), rc);
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync if (!numSharedFolders && details != VMINFO_MACHINEREADABLE)
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync RTPrintf("SharedFolderNameMachineMapping%d=\"%lS\"\n", index + 1,
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync RTPrintf("SharedFolderPathMachineMapping%d=\"%lS\"\n", index + 1,
fdb40b7d2efa84fc6f03b7a695cb4b2e035c30c7vboxsync RTPrintf("Name: '%lS', Host path: '%lS' (machine mapping)\n", name.raw(), hostPath.raw());
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync /* transient mappings */
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync CHECK_ERROR_RET(console, COMGETTER(SharedFolders)(sfColl.asOutParam()), rc);
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync CHECK_ERROR_RET(sfColl, Enumerate(sfEnum.asOutParam()), rc);
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync CHECK_ERROR_RET(sfEnum, GetNext(sf.asOutParam()), rc);
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync if (!numSharedFolders && details != VMINFO_MACHINEREADABLE)
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync RTPrintf("SharedFolderNameTransientMapping%d=\"%lS\"\n", index + 1,
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync RTPrintf("SharedFolderPathTransientMapping%d=\"%lS\"\n", index + 1,
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync RTPrintf("Name: '%lS', Host path: '%lS' (transient mapping)\n", name.raw(), hostPath.raw());
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync if (!numSharedFolders && details != VMINFO_MACHINEREADABLE)
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync * Live VRDP info.
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync CHECK_ERROR_RET(console, COMGETTER(RemoteDisplayInfo)(remoteDisplayInfo.asOutParam()), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(Active) (&Active), rc);
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(NumberOfClients) (&NumberOfClients), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(BeginTime) (&BeginTime), rc);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(EndTime) (&EndTime), rc);
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(BytesSent) (&BytesSent), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(BytesSentTotal) (&BytesSentTotal), rc);
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(BytesReceived) (&BytesReceived), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(BytesReceivedTotal) (&BytesReceivedTotal), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(User) (User.asOutParam ()), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(Domain) (Domain.asOutParam ()), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(ClientName) (ClientName.asOutParam ()), rc);
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(ClientIP) (ClientIP.asOutParam ()), rc);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(ClientVersion) (&ClientVersion), rc);
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync CHECK_ERROR_RET(remoteDisplayInfo, COMGETTER(EncryptionStyle) (&EncryptionStyle), rc);
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync RTPrintf("VRDPActiveConnection=\"%s\"\n", Active ? "on": "off");
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync RTPrintf("VRDP Connection: %s\n", Active? "active": "not active");
0c94a8282c9042b02f022302a3d987746140eab9vboxsync makeTimeStr (timestr, sizeof (timestr), BeginTime);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync makeTimeStr (timestr, sizeof (timestr), BeginTime);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("VRDPThroughputSend=%llu\n", (BytesSent * 1000) / (EndTime - BeginTime) );
0c94a8282c9042b02f022302a3d987746140eab9vboxsync RTPrintf("VRDPBytesSentTotal=%llu\n", BytesSentTotal);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync RTPrintf("VRDPBytesReceived=%llu\n", BytesReceived);
0c94a8282c9042b02f022302a3d987746140eab9vboxsync RTPrintf("VRDPThroughputReceive=%llu\n", (BytesReceived * 1000) / (EndTime - BeginTime) );
0c94a8282c9042b02f022302a3d987746140eab9vboxsync RTPrintf("VRDPBytesReceivedTotal=%llu\n", BytesReceivedTotal);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("Average speed: %llu B/s\n", (BytesSent * 1000) / (EndTime - BeginTime) );
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("Sent total: %llu Bytes\n", BytesSentTotal);
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync RTPrintf("Speed: %llu B/s\n", (BytesReceived * 1000) / (EndTime - BeginTime) );
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync RTPrintf("Received total: %llu Bytes\n", BytesReceivedTotal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("VRDPClientName=\"%lS\"\n", ClientName.raw());
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync RTPrintf("VRDPClientIP=\"%lS\"\n", ClientIP.raw());
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("VRDPEncryption=\"%s\"\n", EncryptionStyle == 0? "RDP4": "RDP5 (X.509)");
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("Encryption: %s\n", EncryptionStyle == 0? "RDP4": "RDP5 (X.509)");
49a6b09abb20015b0af3e618a1f92b7e26785e90vboxsync machine->COMGETTER(Description)(description.asOutParam());
49a6b09abb20015b0af3e618a1f92b7e26785e90vboxsync RTPrintf("description=\"%lS\"\n", description.raw());
49a6b09abb20015b0af3e618a1f92b7e26785e90vboxsync RTPrintf("Description:\n%lS\n", description.raw());
49a6b09abb20015b0af3e618a1f92b7e26785e90vboxsync rc = machine->COMGETTER(MemoryBalloonSize)(&guestVal);
49a6b09abb20015b0af3e618a1f92b7e26785e90vboxsync RTPrintf("Configured memory balloon size: %d MB\n", guestVal);
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync rc = machine->COMGETTER(StatisticsUpdateInterval)(&guestVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("GuestStatisticsUpdateInterval=%d\n", guestVal);
88e56f700a3b8dfdf1646f96320f335e22339caavboxsync RTPrintf("Statistics update interval: %d seconds\n", guestVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = console->COMGETTER(Guest)(guest.asOutParam());
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = guest->GetStatistic(0, GuestStatisticType_SampleNumber, &statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("Guest statistics for sample %d:\n\n", statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = guest->GetStatistic(0, GuestStatisticType_CPULoad_Idle, &statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("StatGuestLoadIdleCPU%d=%d\n", 0, statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("CPU%d: CPU Load Idle %-3d%%\n", 0, statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = guest->GetStatistic(0, GuestStatisticType_CPULoad_Kernel, &statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("StatGuestLoadKernelCPU%d=%d\n", 0, statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("CPU%d: CPU Load Kernel %-3d%%\n", 0, statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = guest->GetStatistic(0, GuestStatisticType_CPULoad_User, &statVal);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("StatGuestLoadUserCPU%d=%d\n", 0, statVal);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync RTPrintf("CPU%d: CPU Load User %-3d%%\n", 0, statVal);
5c4d7e2aae42bbf39793dfa686925f076a56b4d5vboxsync rc = guest->GetStatistic(0, GuestStatisticType_Threads, &statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("StatGuestThreadsCPU%d=%d\n", 0, statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = guest->GetStatistic(0, GuestStatisticType_Processes, &statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("StatGuestProcessesCPU%d=%d\n", 0, statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = guest->GetStatistic(0, GuestStatisticType_Handles, &statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("StatGuestHandlesCPU%d=%d\n", 0, statVal);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync rc = guest->GetStatistic(0, GuestStatisticType_MemoryLoad, &statVal);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync RTPrintf("StatGuestMemoryLoadCPU%d=%d\n", 0, statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = guest->GetStatistic(0, GuestStatisticType_PhysMemTotal, &statVal);
56970d3a1944c7c073d66266cd52449835221badvboxsync RTPrintf("StatGuestMemoryTotalPhysCPU%d=%d\n", 0, statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("CPU%d: Total physical memory %-4d MB\n", 0, statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = guest->GetStatistic(0, GuestStatisticType_PhysMemAvailable, &statVal);
81614fc60e096e714022d10d38b70a36b9b21d48vboxsync RTPrintf("StatGuestMemoryFreePhysCPU%d=%d\n", 0, statVal);
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync RTPrintf("CPU%d: Free physical memory %-4d MB\n", 0, statVal);
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync rc = guest->GetStatistic(0, GuestStatisticType_PhysMemBalloon, &statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("StatGuestMemoryBalloonCPU%d=%d\n", 0, statVal);
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync RTPrintf("CPU%d: Memory balloon size %-4d MB\n", 0, statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = guest->GetStatistic(0, GuestStatisticType_MemCommitTotal, &statVal);
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync RTPrintf("StatGuestMemoryCommittedCPU%d=%d\n", 0, statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("CPU%d: Committed memory %-4d MB\n", 0, statVal);
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync rc = guest->GetStatistic(0, GuestStatisticType_MemKernelTotal, &statVal);
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync RTPrintf("StatGuestMemoryTotalKernelCPU%d=%d\n", 0, statVal);
44372afb953dc9f1f1ec71943f5f561a607c0307vboxsync RTPrintf("CPU%d: Total kernel memory %-4d MB\n", 0, statVal);
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync rc = guest->GetStatistic(0, GuestStatisticType_MemKernelPaged, &statVal);
4f4cb69bca6bfda8f4d911759d1f3c6f528a173dvboxsync RTPrintf("StatGuestMemoryPagedKernelCPU%d=%d\n", 0, statVal);
82e3a4017d20f44c30ff909e6b825ff78139cbbbvboxsync RTPrintf("CPU%d: Paged kernel memory %-4d MB\n", 0, statVal);
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync rc = guest->GetStatistic(0, GuestStatisticType_MemKernelNonpaged, &statVal);
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync RTPrintf("StatGuestMemoryNonpagedKernelCPU%d=%d\n", 0, statVal);
d7cf060b16385dd6e5af7c74cd49c9ef8ffb3b22vboxsync RTPrintf("CPU%d: Nonpaged kernel memory %-4d MB\n", 0, statVal);
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync rc = guest->GetStatistic(0, GuestStatisticType_MemSystemCache, &statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("StatGuestSystemCacheSizeCPU%d=%d\n", 0, statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("CPU%d: System cache size %-4d MB\n", 0, statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = guest->GetStatistic(0, GuestStatisticType_PageFileSize, &statVal);
19320d55d1417c39b3b5673a53aaa5ef177242c8vboxsync RTPrintf("StatGuestPageFileSizeCPU%d=%d\n", 0, statVal);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("CPU%d: Page file size %-4d MB\n", 0, statVal);
56970d3a1944c7c073d66266cd52449835221badvboxsync RTPrintf("[!] FAILED calling console->getGuest at line %d!\n", __LINE__);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync * snapshots
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = machine->GetSnapshot(Guid(), snapshot.asOutParam());
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync ComPtr<IVirtualBox> virtualBox, ComPtr<ISession> session)
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /* at least one option: the UUID or name of the VM */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync return errorSyntax(USAGE_SHOWVMINFO, "Incorrect number of parameters");
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /* try to find the given machine */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync CHECK_ERROR (virtualBox, GetMachine (uuid, machine.asOutParam()));
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync CHECK_ERROR (virtualBox, FindMachine (Bstr(argv[0]), machine.asOutParam()));
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync /* 2nd option can be -details, -statistics or -argdump */
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync bool fDetails = false;
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync bool fStatistics = false;
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /* open an existing session for the VM */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = virtualBox->OpenExistingSession (session, uuid);
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /* get the session machine */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = session->COMGETTER(Machine)(machine.asOutParam());
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /* get the session console */
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = session->COMGETTER(Console)(console.asOutParam());
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync rc = showVMInfo (virtualBox, machine, console, details);
44372afb953dc9f1f1ec71943f5f561a607c0307vboxsync ComPtr<IVirtualBox> virtualBox, ComPtr<ISession> session)
81614fc60e096e714022d10d38b70a36b9b21d48vboxsync /* exactly one option: the object */
81614fc60e096e714022d10d38b70a36b9b21d48vboxsync return errorSyntax(USAGE_LIST, "Incorrect number of parameters");
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync /* which object? */
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync * Get the list of all registered VMs
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync rc = virtualBox->COMGETTER(Machines)(collection.asOutParam());
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync rc = collection->Enumerate(enumerator.asOutParam());
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync * Iterate through the collection
9540ab73f6cd0c76f44f6bbfe73f89ac145390b8vboxsync CHECK_ERROR(virtualBox, COMGETTER(GuestOSTypes)(coll.asOutParam()));
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync CHECK_ERROR(coll, Enumerate(enumerator.asOutParam()));
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync while (SUCCEEDED(enumerator->HasMore(&hasMore)) && hasMore)
29099c2d04b11e614f1fa399fab9e9162f2788b9vboxsync CHECK_RC_BREAK(enumerator->GetNext(guestOS.asOutParam()));
56970d3a1944c7c073d66266cd52449835221badvboxsync guestOS->COMGETTER(Description)(guestDescription.asOutParam());
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync RTPrintf("Description: %lS\n\n", guestDescription.raw());
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync CHECK_ERROR(virtualBox, COMGETTER(Host)(host.asOutParam()));
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync CHECK_ERROR(host, COMGETTER(DVDDrives)(coll.asOutParam()));
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync CHECK_ERROR(coll, Enumerate(enumerator.asOutParam()));
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync while (SUCCEEDED(enumerator->HasMore(&hasMore)) && hasMore)
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync CHECK_RC_BREAK(enumerator->GetNext(dvdDrive.asOutParam()));
56970d3a1944c7c073d66266cd52449835221badvboxsync CHECK_ERROR(virtualBox, COMGETTER(Host)(host.asOutParam()));
0c94a8282c9042b02f022302a3d987746140eab9vboxsync CHECK_ERROR(host, COMGETTER(FloppyDrives)(coll.asOutParam()));
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync CHECK_ERROR(coll, Enumerate(enumerator.asOutParam()));
e250515922582e0410c9bcb6d24b0f17bef083a0vboxsync while (SUCCEEDED(enumerator->HasMore(&hasMore)) && hasMore)
0c69348b58bb8eabb1bea8867ee932b667bd0d34vboxsync CHECK_RC_BREAK(enumerator->GetNext(floppyDrive.asOutParam()));
#ifdef RT_OS_WINDOWS
switch (storageType)
CHECK_ERROR(virtualBox, GetFloppyImageUsage(uuid, ResourceUsage_AllUsage, machineUUIDs.asOutParam()));
if (!fMore)
while (fMore)
switch (state)
ASSERT (false);
if (!more)
while (more)
switch (action)
index ++;
if (machine)
bool fStatic = false;
bool fRegister = false;
for (int i = 0; i < argc; i++)
fStatic = true;
fRegister = true;
CHECK_ERROR(virtualBox, CreateHardDisk(HardDiskStorageType_VirtualDiskImage, hardDisk.asOutParam()));
if (fStatic)
return VINF_SUCCESS;
if (!hardDisk)
if (!hardDisk)
if (!vdi)
if (!vdi)
unsigned uProcent;
if (!hardDisk)
if (hardDisk)
#ifdef RT_OS_LINUX
const bool fReadFromStdIn = false;
if (fReadFromStdIn)
File = 0;
return rc;
if (fReadFromStdIn)
RTPrintf("Creating fixed image with size %RU64Bytes (%RU64MB)...\n", cbFile, (cbFile + _1M - 1) / _1M);
if (pvBuf)
return rc;
for (int i = 0; i < argc; i++)
char *pszNext;
char *pszNext;
bool fRegister = false;
for (int i = 0; i < argc; i++)
fRegister = true;
if (!name)
if (!settingsFile)
if (fRegister)
char *pszNext;
return (unsigned)u32;
#ifdef VBOX_VRDP
#ifdef RT_OS_LINUX
ULONG n = 0;
#ifdef RT_OS_LINUX
#ifdef VBOX_VRDP
vrdpport = 0;
fUsbEnabled = 0;
#ifdef RT_OS_WINDOWS
if (argc <= i)
int vrc;
int vrc;
int vrc;
if (name)
if (ostype)
if (memorySize > 0)
if (vramSize > 0)
if (acpi)
if (ioapic)
if (hwvirtex)
if (bioslogofadein)
if (bioslogofadeout)
if (bioslogodisplaytime != ~0U)
if (bioslogoimagepath)
if (biosbootmenumode)
if (biossystemtimeoffset)
if (biospxedebug)
if (hdds[0])
if (!hardDisk)
if (hardDisk)
if (!hardDisk)
if (hardDisk)
if (!hardDisk)
if (hardDisk)
if (dvd)
if (!hostDVDDrive)
if (!hostDVDDrive)
if (!dvdImage)
if (!dvdImage)
if (dvdpassthrough)
if (floppy)
if (!hostFloppyDrive)
if (!floppyImage)
if (audio)
#ifdef RT_OS_WINDOWS
#ifdef VBOX_WITH_WINMM
#ifdef RT_OS_LINUX
# ifdef VBOX_WITH_ALSA
#ifdef RT_OS_DARWIN
if (clipboard)
if (nics[n])
if (nictype[n])
if (macs[n])
if (nicspeed[n])
if (cableconnected[n])
if (nictrace[n])
if (nictracefile[n])
if (hostifdev[n])
if (intnet[n])
#ifdef RT_OS_LINUX
if (tapsetup[n])
if (tapterm[n])
if (uarts_base[n])
if (uarts_mode[n])
#ifdef VBOX_VRDP
if (vrdpServer)
if (vrdp)
if (vrdpaddress)
if (vrdpauthtype)
if (vrdpmulticon)
if (snapshotFolder)
if (machine)
#ifdef RT_OS_LINUX
if (display)
if (adapter)
if (attach)
if (attach)
bool fAllowLocalLogon = true;
fAllowLocalLogon = false;
CHECK_ERROR_BREAK(guest, SetCredentials(Bstr(argv[2]), Bstr(argv[3]), Bstr(argv[4]), fAllowLocalLogon));
if (!hostDVDDrive)
if (!dvdImage)
if (!dvdImage)
if (!hostFloppyDrive)
if (!floppyImage)
if (!floppyImage)
int vrc;
int vrc;
if (machine)
if (!machine)
bool fAll = false;
fAll = true;
if (fAll)
bool registered = true;
registered = false;
if (!accessible)
if (description)
switch (type)
switch (storageType)
if (registered)
if (vdi)
if (type)
if (!hardDisk)
if (!dvdImage)
if (!floppyImage)
#ifdef RT_OS_WINDOWS
} while (extraDataKey);
if (value)
if (machine)
} while (extraDataKey);
if (value)
if (machine)
int vrc;
if (!machine)
bool fTransient = false;
fTransient = true;
if (fTransient)
if (console)
bool fTransient = false;
fTransient = true;
if (!name)
if (fTransient)
if (console)
bool fWithDescriptions = false;
if (pszPattern)
fWithDescriptions = true;
&errMsg);
if (errMsg)
return vrc;
bool skipInvalid)
return vrc;
if (skipInvalid)
return vrc;
bool apply = false;
bool nobackup = false;
bool skipinvalid = false;
for (int i = 0; i < argc; i++)
apply = true;
nobackup = true;
skipinvalid = true;
if (apply)
if (dirOrFilePath)
RTR3Init(false);
bool fShowLogo = true;
int iCmdArg;
showLogo();
exit(0);
fShowLogo = false;
iCmd++;
if (fShowLogo)
showLogo();
char *converted;
const char *command;
} commandHandlers[] =
#ifdef RT_OS_WINDOWS
int commandIndex;
return rc;