VBoxManageHelp.cpp revision c0a5da26f7222b0a486d6d9ba4d1f475a78a2c73
6a67d144095c31bbafed93cec1619590157335eajvergara/* $Id$ */
6a67d144095c31bbafed93cec1619590157335eajvergara/** @file
6a67d144095c31bbafed93cec1619590157335eajvergara * VBoxManage - help and other message output.
6a67d144095c31bbafed93cec1619590157335eajvergara */
6a67d144095c31bbafed93cec1619590157335eajvergara
6a67d144095c31bbafed93cec1619590157335eajvergara/*
6a67d144095c31bbafed93cec1619590157335eajvergara * Copyright (C) 2006-2012 Oracle Corporation
6a67d144095c31bbafed93cec1619590157335eajvergara *
6a67d144095c31bbafed93cec1619590157335eajvergara * This file is part of VirtualBox Open Source Edition (OSE), as
6a67d144095c31bbafed93cec1619590157335eajvergara * available from http://www.virtualbox.org. This file is free software;
6a67d144095c31bbafed93cec1619590157335eajvergara * you can redistribute it and/or modify it under the terms of the GNU
6a67d144095c31bbafed93cec1619590157335eajvergara * General Public License (GPL) as published by the Free Software
6a67d144095c31bbafed93cec1619590157335eajvergara * Foundation, in version 2 as it comes in the "COPYING" file of the
6a67d144095c31bbafed93cec1619590157335eajvergara * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
6a67d144095c31bbafed93cec1619590157335eajvergara * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
6a67d144095c31bbafed93cec1619590157335eajvergara */
6a67d144095c31bbafed93cec1619590157335eajvergara
6a67d144095c31bbafed93cec1619590157335eajvergara
f71f7a61dec7c9089378d14493ad564a1dedf0b5neil_a_wilson/*******************************************************************************
6a67d144095c31bbafed93cec1619590157335eajvergara* Header Files *
6a67d144095c31bbafed93cec1619590157335eajvergara*******************************************************************************/
6a67d144095c31bbafed93cec1619590157335eajvergara#include <VBox/version.h>
6a67d144095c31bbafed93cec1619590157335eajvergara
6a67d144095c31bbafed93cec1619590157335eajvergara#include <iprt/buildconfig.h>
d6c71e7b06ef8919af4c8186b4ffb08766c20a09neil_a_wilson#include <iprt/ctype.h>
6a67d144095c31bbafed93cec1619590157335eajvergara#include <iprt/err.h>
6a67d144095c31bbafed93cec1619590157335eajvergara#include <iprt/getopt.h>
6a67d144095c31bbafed93cec1619590157335eajvergara#include <iprt/stream.h>
6a67d144095c31bbafed93cec1619590157335eajvergara
6a67d144095c31bbafed93cec1619590157335eajvergara#include "VBoxManage.h"
6a67d144095c31bbafed93cec1619590157335eajvergara
6a67d144095c31bbafed93cec1619590157335eajvergara
2401d3c2af505789c7c3b860a43e973f27731243jvergara
2401d3c2af505789c7c3b860a43e973f27731243jvergaravoid showLogo(PRTSTREAM pStrm)
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara{
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara static bool s_fShown; /* show only once */
6a67d144095c31bbafed93cec1619590157335eajvergara
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter if (!s_fShown)
6a67d144095c31bbafed93cec1619590157335eajvergara {
6a67d144095c31bbafed93cec1619590157335eajvergara RTStrmPrintf(pStrm, VBOX_PRODUCT " Command Line Management Interface Version "
6a67d144095c31bbafed93cec1619590157335eajvergara VBOX_VERSION_STRING "\n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara "(C) 2005-" VBOX_C_YEAR " " VBOX_VENDOR "\n"
0877596da3b90efc5fd39171cef80a2fb8ec395ekenneth_suter "All rights reserved.\n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara "\n");
0877596da3b90efc5fd39171cef80a2fb8ec395ekenneth_suter s_fShown = true;
6a67d144095c31bbafed93cec1619590157335eajvergara }
6a67d144095c31bbafed93cec1619590157335eajvergara}
4c5f6e1826364b5d627620cbc906da0d48ec5348jvergara
6a67d144095c31bbafed93cec1619590157335eajvergaravoid printUsage(USAGECATEGORY u64Cmd, PRTSTREAM pStrm)
6a67d144095c31bbafed93cec1619590157335eajvergara{
6a67d144095c31bbafed93cec1619590157335eajvergara bool fDumpOpts = false;
6a67d144095c31bbafed93cec1619590157335eajvergara#ifdef RT_OS_LINUX
6a67d144095c31bbafed93cec1619590157335eajvergara bool fLinux = true;
6a67d144095c31bbafed93cec1619590157335eajvergara#else
6a67d144095c31bbafed93cec1619590157335eajvergara bool fLinux = false;
6a67d144095c31bbafed93cec1619590157335eajvergara#endif
6a67d144095c31bbafed93cec1619590157335eajvergara#ifdef RT_OS_WINDOWS
6a67d144095c31bbafed93cec1619590157335eajvergara bool fWin = true;
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter#else
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter bool fWin = false;
6a67d144095c31bbafed93cec1619590157335eajvergara#endif
6a67d144095c31bbafed93cec1619590157335eajvergara#ifdef RT_OS_SOLARIS
6a67d144095c31bbafed93cec1619590157335eajvergara bool fSolaris = true;
6a67d144095c31bbafed93cec1619590157335eajvergara#else
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara bool fSolaris = false;
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara#endif
6a67d144095c31bbafed93cec1619590157335eajvergara#ifdef RT_OS_FREEBSD
6a67d144095c31bbafed93cec1619590157335eajvergara bool fFreeBSD = true;
7b6b125d52edabd5b1c9134feef7aeae0e69499ekenneth_suter#else
6a67d144095c31bbafed93cec1619590157335eajvergara bool fFreeBSD = false;
7b6b125d52edabd5b1c9134feef7aeae0e69499ekenneth_suter#endif
6a67d144095c31bbafed93cec1619590157335eajvergara#ifdef RT_OS_DARWIN
7b6b125d52edabd5b1c9134feef7aeae0e69499ekenneth_suter bool fDarwin = true;
6a67d144095c31bbafed93cec1619590157335eajvergara#else
6a67d144095c31bbafed93cec1619590157335eajvergara bool fDarwin = false;
6a67d144095c31bbafed93cec1619590157335eajvergara#endif
6a67d144095c31bbafed93cec1619590157335eajvergara#ifdef VBOX_WITH_VBOXSDL
6a67d144095c31bbafed93cec1619590157335eajvergara bool fVBoxSDL = true;
6a67d144095c31bbafed93cec1619590157335eajvergara#else
6a67d144095c31bbafed93cec1619590157335eajvergara bool fVBoxSDL = false;
6a67d144095c31bbafed93cec1619590157335eajvergara#endif
6a67d144095c31bbafed93cec1619590157335eajvergara
6a67d144095c31bbafed93cec1619590157335eajvergara if (u64Cmd == USAGE_DUMPOPTS)
6a67d144095c31bbafed93cec1619590157335eajvergara {
6a67d144095c31bbafed93cec1619590157335eajvergara fDumpOpts = true;
6a67d144095c31bbafed93cec1619590157335eajvergara fLinux = true;
6a67d144095c31bbafed93cec1619590157335eajvergara fWin = true;
6a67d144095c31bbafed93cec1619590157335eajvergara fSolaris = true;
6a67d144095c31bbafed93cec1619590157335eajvergara fFreeBSD = true;
6a67d144095c31bbafed93cec1619590157335eajvergara fDarwin = true;
6a67d144095c31bbafed93cec1619590157335eajvergara fVBoxSDL = true;
2401d3c2af505789c7c3b860a43e973f27731243jvergara u64Cmd = USAGE_ALL;
2401d3c2af505789c7c3b860a43e973f27731243jvergara }
2401d3c2af505789c7c3b860a43e973f27731243jvergara
2401d3c2af505789c7c3b860a43e973f27731243jvergara RTStrmPrintf(pStrm,
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara "Usage:\n"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara "\n");
2401d3c2af505789c7c3b860a43e973f27731243jvergara
2401d3c2af505789c7c3b860a43e973f27731243jvergara if (u64Cmd == USAGE_ALL)
2401d3c2af505789c7c3b860a43e973f27731243jvergara RTStrmPrintf(pStrm,
2401d3c2af505789c7c3b860a43e973f27731243jvergara " VBoxManage [<general option>] <command>\n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara " \n \n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara "General Options:\n \n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara " [-v|--version] print version number and exit\n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara " [-q|--nologo] suppress the logo\n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara " [--settingspw <pw>] provide the settings password\n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara " [--settingspwfile <file>] provide a file containing the settings password\n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara " \n \n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara "Commands:\n \n");
6a67d144095c31bbafed93cec1619590157335eajvergara
6a67d144095c31bbafed93cec1619590157335eajvergara const char *pcszSep1 = " ";
6a67d144095c31bbafed93cec1619590157335eajvergara const char *pcszSep2 = " ";
6a67d144095c31bbafed93cec1619590157335eajvergara if (u64Cmd != USAGE_ALL)
6a67d144095c31bbafed93cec1619590157335eajvergara {
6a67d144095c31bbafed93cec1619590157335eajvergara pcszSep1 = "VBoxManage";
6a67d144095c31bbafed93cec1619590157335eajvergara pcszSep2 = "";
6a67d144095c31bbafed93cec1619590157335eajvergara }
6a67d144095c31bbafed93cec1619590157335eajvergara
6a67d144095c31bbafed93cec1619590157335eajvergara#define SEP pcszSep1, pcszSep2
6a67d144095c31bbafed93cec1619590157335eajvergara
6a67d144095c31bbafed93cec1619590157335eajvergara if (u64Cmd & USAGE_LIST)
6a67d144095c31bbafed93cec1619590157335eajvergara RTStrmPrintf(pStrm,
6a67d144095c31bbafed93cec1619590157335eajvergara "%s list [--long|-l]%s vms|runningvms|ostypes|hostdvds|hostfloppies|\n"
6a67d144095c31bbafed93cec1619590157335eajvergara#if defined(VBOX_WITH_NETFLT)
6a67d144095c31bbafed93cec1619590157335eajvergara " bridgedifs|hostonlyifs|dhcpservers|hostinfo|\n"
0877596da3b90efc5fd39171cef80a2fb8ec395ekenneth_suter#else
6a67d144095c31bbafed93cec1619590157335eajvergara " bridgedifs|dhcpservers|hostinfo|\n"
6a67d144095c31bbafed93cec1619590157335eajvergara#endif
6a67d144095c31bbafed93cec1619590157335eajvergara " hostcpuids|hddbackends|hdds|dvds|floppies|\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " usbhost|usbfilters|systemproperties|extpacks|\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " groups\n"
6a67d144095c31bbafed93cec1619590157335eajvergara "\n", SEP);
6a67d144095c31bbafed93cec1619590157335eajvergara
6a67d144095c31bbafed93cec1619590157335eajvergara if (u64Cmd & USAGE_SHOWVMINFO)
6a67d144095c31bbafed93cec1619590157335eajvergara RTStrmPrintf(pStrm,
6a67d144095c31bbafed93cec1619590157335eajvergara "%s showvminfo %s <uuid>|<name> [--details]\n"
0877596da3b90efc5fd39171cef80a2fb8ec395ekenneth_suter " [--machinereadable]\n"
ffa279622cea61d6eec13e3df386bd3015388388jvergara "%s showvminfo %s <uuid>|<name> --log <idx>\n"
6a67d144095c31bbafed93cec1619590157335eajvergara "\n", SEP, SEP);
6a67d144095c31bbafed93cec1619590157335eajvergara
6a67d144095c31bbafed93cec1619590157335eajvergara if (u64Cmd & USAGE_REGISTERVM)
6a67d144095c31bbafed93cec1619590157335eajvergara RTStrmPrintf(pStrm,
6a67d144095c31bbafed93cec1619590157335eajvergara "%s registervm %s <filename>\n"
6a67d144095c31bbafed93cec1619590157335eajvergara "\n", SEP);
6a67d144095c31bbafed93cec1619590157335eajvergara
6a67d144095c31bbafed93cec1619590157335eajvergara if (u64Cmd & USAGE_UNREGISTERVM)
6a67d144095c31bbafed93cec1619590157335eajvergara RTStrmPrintf(pStrm,
6a67d144095c31bbafed93cec1619590157335eajvergara "%s unregistervm %s <uuid>|<name> [--delete]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara "\n", SEP);
6a67d144095c31bbafed93cec1619590157335eajvergara
6a67d144095c31bbafed93cec1619590157335eajvergara if (u64Cmd & USAGE_CREATEVM)
6a67d144095c31bbafed93cec1619590157335eajvergara RTStrmPrintf(pStrm,
6a67d144095c31bbafed93cec1619590157335eajvergara "%s createvm %s --name <name>\n"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara " [--groups <group>, ...]\n"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara " [--ostype <ostype>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--register]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--basefolder <path>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--uuid <uuid>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara "\n", SEP);
6a67d144095c31bbafed93cec1619590157335eajvergara
6a67d144095c31bbafed93cec1619590157335eajvergara if (u64Cmd & USAGE_MODIFYVM)
6a67d144095c31bbafed93cec1619590157335eajvergara {
6a67d144095c31bbafed93cec1619590157335eajvergara RTStrmPrintf(pStrm,
6a67d144095c31bbafed93cec1619590157335eajvergara "%s modifyvm %s <uuid|name>\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--name <name>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--groups <group>, ...]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--ostype <ostype>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--memory <memorysize in MB>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--pagefusion on|off]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--vram <vramsize in MB>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--acpi on|off]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara#ifdef VBOX_WITH_PCI_PASSTHROUGH
6a67d144095c31bbafed93cec1619590157335eajvergara " [--pciattach 03:04.0]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--pciattach 03:04.0@02:01.0]\n"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara " [--pcidetach 03:04.0]\n"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara#endif
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara " [--ioapic on|off]\n"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara " [--pae on|off]\n"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara " [--hpet on|off]\n"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara " [--hwvirtex on|off]\n"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara " [--hwvirtexexcl on|off]\n"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara " [--nestedpaging on|off]\n"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara " [--largepages on|off]\n"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara " [--vtxvpid on|off]\n"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara " [--synthcpu on|off]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--cpuidset <leaf> <eax> <ebx> <ecx> <edx>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--cpuidremove <leaf>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--cpuidremoveall]\n"
0877596da3b90efc5fd39171cef80a2fb8ec395ekenneth_suter " [--hardwareuuid <uuid>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--cpus <number>]\n"
0877596da3b90efc5fd39171cef80a2fb8ec395ekenneth_suter " [--cpuhotplug on|off]\n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara " [--plugcpu <id>]\n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara " [--unplugcpu <id>]\n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara " [--cpuexecutioncap <1-100>]\n"
252ea19a057499e16910a99b951793bdd6d468f7kenneth_suter " [--rtcuseutc on|off]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--monitorcount <number>]\n"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara " [--accelerate3d on|off]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter#ifdef VBOX_WITH_VIDEOHWACCEL
0877596da3b90efc5fd39171cef80a2fb8ec395ekenneth_suter " [--accelerate2dvideo on|off]\n"
0877596da3b90efc5fd39171cef80a2fb8ec395ekenneth_suter#endif
0877596da3b90efc5fd39171cef80a2fb8ec395ekenneth_suter " [--firmware bios|efi|efi32|efi64]\n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara " [--chipset ich9|piix3]\n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara " [--bioslogofadein on|off]\n"
2401d3c2af505789c7c3b860a43e973f27731243jvergara " [--bioslogofadeout on|off]\n"
76d78217d6ca09688d73efe4da48c76e6abc1f23kenneth_suter " [--bioslogodisplaytime <msec>]\n"
76d78217d6ca09688d73efe4da48c76e6abc1f23kenneth_suter " [--bioslogoimagepath <imagepath>]\n"
c9d984b0d2c0fda320e79eb3868dd6fbeb1ffa34jvergara " [--biosbootmenu disabled|menuonly|messageandmenu]\n"
c9d984b0d2c0fda320e79eb3868dd6fbeb1ffa34jvergara " [--biossystemtimeoffset <msec>]\n"
c9d984b0d2c0fda320e79eb3868dd6fbeb1ffa34jvergara " [--biospxedebug on|off]\n"
c9d984b0d2c0fda320e79eb3868dd6fbeb1ffa34jvergara " [--boot<1-4> none|floppy|dvd|disk|net>]\n"
c9d984b0d2c0fda320e79eb3868dd6fbeb1ffa34jvergara " [--nic<1-N> none|null|nat|bridged|intnet"
c9d984b0d2c0fda320e79eb3868dd6fbeb1ffa34jvergara#if defined(VBOX_WITH_NETFLT)
c9d984b0d2c0fda320e79eb3868dd6fbeb1ffa34jvergara "|hostonly"
c9d984b0d2c0fda320e79eb3868dd6fbeb1ffa34jvergara#endif
6a67d144095c31bbafed93cec1619590157335eajvergara "|\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " generic"
6a67d144095c31bbafed93cec1619590157335eajvergara "]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--nictype<1-N> Am79C970A|Am79C973"
6a67d144095c31bbafed93cec1619590157335eajvergara#ifdef VBOX_WITH_E1000
6a67d144095c31bbafed93cec1619590157335eajvergara "|\n 82540EM|82543GC|82545EM"
6a67d144095c31bbafed93cec1619590157335eajvergara#endif
6a67d144095c31bbafed93cec1619590157335eajvergara#ifdef VBOX_WITH_VIRTIO
6a67d144095c31bbafed93cec1619590157335eajvergara "|\n virtio"
6a67d144095c31bbafed93cec1619590157335eajvergara#endif /* VBOX_WITH_VIRTIO */
6a67d144095c31bbafed93cec1619590157335eajvergara "]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--cableconnected<1-N> on|off]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--nictrace<1-N> on|off]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--nictracefile<1-N> <filename>]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--nicproperty<1-N> name=[value]]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--nicspeed<1-N> <kbps>]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--nicbootprio<1-N> <priority>]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--nicpromisc<1-N> deny|allow-vms|allow-all]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--nicbandwidthgroup<1-N> none|<name>]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--bridgeadapter<1-N> none|<devicename>]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter#if defined(VBOX_WITH_NETFLT)
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--hostonlyadapter<1-N> none|<devicename>]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter#endif
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--intnet<1-N> <network name>]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--natnet<1-N> <network>|default]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--nicgenericdrv<1-N> <driver>\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--natsettings<1-N> [<mtu>],[<socksnd>],\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [<sockrcv>],[<tcpsnd>],\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [<tcprcv>]]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--natpf<1-N> [<rulename>],tcp|udp,[<hostip>],\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " <hostport>,[<guestip>],<guestport>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--natpf<1-N> delete <rulename>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--nattftpprefix<1-N> <prefix>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--nattftpfile<1-N> <file>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--nattftpserver<1-N> <ip>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--natbindip<1-N> <ip>\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--natdnspassdomain<1-N> on|off]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--natdnsproxy<1-N> on|off]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--natdnshostresolver<1-N> on|off]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--nataliasmode<1-N> default|[log],[proxyonly],\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [sameports]]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--macaddress<1-N> auto|<mac>]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--mouse ps2|usb|usbtablet\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--keyboard ps2|usb\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--uart<1-N> off|<I/O base> <IRQ>]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--uartmode<1-N> disconnected|\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " server <pipe>|\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " client <pipe>|\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " file <file>|\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " <devicename>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--lpt<1-N> off|<I/O base> <IRQ>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--lptmode<1-N> <devicename>]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara#endif
6a67d144095c31bbafed93cec1619590157335eajvergara " [--guestmemoryballoon <balloonsize in MB>]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--gueststatisticsinterval <seconds>]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--audio none|null", SEP);
6a67d144095c31bbafed93cec1619590157335eajvergara if (fWin)
6a67d144095c31bbafed93cec1619590157335eajvergara {
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter#ifdef VBOX_WITH_WINMM
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara RTStrmPrintf(pStrm, "|winmm|dsound");
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara#else
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara RTStrmPrintf(pStrm, "|dsound");
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara#endif
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara }
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara if (fSolaris)
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara {
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara RTStrmPrintf(pStrm, "|solaudio"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara#ifdef VBOX_WITH_SOLARIS_OSS
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara "|oss"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara#endif
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara );
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara }
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara if (fLinux)
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara {
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara RTStrmPrintf(pStrm, "|oss"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara#ifdef VBOX_WITH_ALSA
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara "|alsa"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara#endif
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara#ifdef VBOX_WITH_PULSE
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara "|pulse"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara#endif
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara );
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara }
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara if (fFreeBSD)
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara {
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara /* Get the line break sorted when dumping all option variants. */
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara if (fDumpOpts)
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara {
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara RTStrmPrintf(pStrm, "|\n"
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara " oss");
48013e6d1c0677bd7649309e6b0b611b6c364c77jvergara }
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter else
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter RTStrmPrintf(pStrm, "|oss");
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter#ifdef VBOX_WITH_PULSE
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter RTStrmPrintf(pStrm, "|pulse");
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter#endif
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter }
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter if (fDarwin)
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter {
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter RTStrmPrintf(pStrm, "|coreaudio");
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter }
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter RTStrmPrintf(pStrm, "]\n");
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter RTStrmPrintf(pStrm,
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--audiocontroller ac97|hda|sb16]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--clipboard disabled|hosttoguest|guesttohost|\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " bidirectional]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--draganddrop disabled|hosttoguest\n");
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter RTStrmPrintf(pStrm,
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--vrde on|off]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--vrdeextpack default|<name>\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--vrdeproperty <name=[value]>]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--vrdeport <hostport>]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--vrdeaddress <hostip>]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--vrdeauthtype null|external|guest]\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--vrdeauthlibrary default|<name>\n"
0142bbb7ccb5d0efb942c20f5d27e5ddfb4344fdkenneth_suter " [--vrdemulticon on|off]\n"
6a67d144095c31bbafed93cec1619590157335eajvergara " [--vrdereusecon on|off]\n"
" [--vrdevideochannel on|off]\n"
" [--vrdevideochannelquality <percent>]\n");
RTStrmPrintf(pStrm,
" [--usb on|off]\n"
" [--usbehci on|off]\n"
" [--snapshotfolder default|<path>]\n"
" [--teleporter on|off]\n"
" [--teleporterport <port>]\n"
" [--teleporteraddress <address|empty>\n"
" [--teleporterpassword <password>]\n"
" [--teleporterpasswordfile <file>|stdin]\n"
" [--tracing-enabled on|off]\n"
" [--tracing-config <config-string>]\n"
" [--tracing-allow-vm-access on|off]\n"
#if 0
" [--iocache on|off]\n"
" [--iocachesize <I/O cache size in MB>]\n"
#endif
#if 0
" [--faulttolerance master|standby]\n"
" [--faulttoleranceaddress <name>]\n"
" [--faulttoleranceport <port>]\n"
" [--faulttolerancesyncinterval <msec>]\n"
" [--faulttolerancepassword <password>]\n"
#endif
#ifdef VBOX_WITH_USB_CARDREADER
" [--usbcardreader on|off]\n"
#endif
" [--autostart-enabled on|off]\n"
" [--autostart-delay <seconds>]\n"
#if 0 /* Disabled until the feature is implemented. */
" [--autostop-type disabled|savestate|poweroff|\n"
" acpishutdown]\n"
#endif
"\n");
}
if (u64Cmd & USAGE_CLONEVM)
RTStrmPrintf(pStrm,
"%s clonevm %s <uuid>|<name>\n"
" [--snapshot <uuid>|<name>]\n"
" [--mode machine|machineandchildren|all]\n"
" [--options link|keepallmacs|keepnatmacs|\n"
" keepdisknames]\n"
" [--name <name>]\n"
" [--groups <group>, ...]\n"
" [--basefolder <basefolder>]\n"
" [--uuid <uuid>]\n"
" [--register]\n"
"\n", SEP);
if (u64Cmd & USAGE_IMPORTAPPLIANCE)
RTStrmPrintf(pStrm,
"%s import %s <ovf/ova>\n"
" [--dry-run|-n]\n"
" [--options keepallmacs|keepnatmacs]\n"
" [more options]\n"
" (run with -n to have options displayed\n"
" for a particular OVF)\n\n", SEP);
if (u64Cmd & USAGE_EXPORTAPPLIANCE)
RTStrmPrintf(pStrm,
"%s export %s <machines> --output|-o <name>.<ovf/ova>\n"
" [--legacy09|--ovf09|--ovf10|--ovf20]\n"
" [--manifest]\n"
" [--vsys <number of virtual system>]\n"
" [--product <product name>]\n"
" [--producturl <product url>]\n"
" [--vendor <vendor name>]\n"
" [--vendorurl <vendor url>]\n"
" [--version <version info>]\n"
" [--eula <license text>]\n"
" [--eulafile <filename>]\n"
"\n", SEP);
if (u64Cmd & USAGE_STARTVM)
{
RTStrmPrintf(pStrm,
"%s startvm %s <uuid>|<name>...\n"
" [--type gui", SEP);
if (fVBoxSDL)
RTStrmPrintf(pStrm, "|sdl");
RTStrmPrintf(pStrm, "|headless]\n");
RTStrmPrintf(pStrm,
"\n");
}
if (u64Cmd & USAGE_CONTROLVM)
{
RTStrmPrintf(pStrm,
"%s controlvm %s <uuid>|<name>\n"
" pause|resume|reset|poweroff|savestate|\n"
" acpipowerbutton|acpisleepbutton|\n"
" keyboardputscancode <hex> [<hex> ...]|\n"
" setlinkstate<1-N> on|off |\n"
#if defined(VBOX_WITH_NETFLT)
" nic<1-N> null|nat|bridged|intnet|hostonly|generic"
"\n"
" [<devicename>] |\n"
#else /* !VBOX_WITH_NETFLT */
" nic<1-N> null|nat|bridged|intnet|generic\n"
" [<devicename>] |\n"
#endif /* !VBOX_WITH_NETFLT */
" nictrace<1-N> on|off\n"
" nictracefile<1-N> <filename>\n"
" nicproperty<1-N> name=[value]\n"
" natpf<1-N> [<rulename>],tcp|udp,[<hostip>],\n"
" <hostport>,[<guestip>],<guestport>\n"
" natpf<1-N> delete <rulename>\n"
" guestmemoryballoon <balloonsize in MB>]\n"
" gueststatisticsinterval <seconds>]\n"
" usbattach <uuid>|<address> |\n"
" usbdetach <uuid>|<address> |\n"
" clipboard disabled|hosttoguest|guesttohost|\n"
" bidirectional]\n"
" draganddrop disabled|hosttoguest]\n"
" vrde on|off |\n"
" vrdeport <port> |\n"
" vrdeproperty <name=[value]> |\n"
" vrdevideochannelquality <percent>\n"
" setvideomodehint <xres> <yres> <bpp>\n"
" [[<display>] [<enabled:yes|no>\n"
" [<xorigin> <yorigin>]]] |\n"
" screenshotpng <file> [display] |\n"
" setcredentials <username>\n"
" --passwordfile <file> | <password>\n"
" <domain>\n"
" [--allowlocallogon <yes|no>] |\n"
" teleport --host <name> --port <port>\n"
" [--maxdowntime <msec>]\n"
" [--passwordfile <file> |\n"
" --password <password>]\n"
" plugcpu <id>\n"
" unplugcpu <id>\n"
" cpuexecutioncap <1-100>\n"
"\n", SEP);
}
if (u64Cmd & USAGE_DISCARDSTATE)
RTStrmPrintf(pStrm,
"%s discardstate %s <uuid>|<name>\n"
"\n", SEP);
if (u64Cmd & USAGE_ADOPTSTATE)
RTStrmPrintf(pStrm,
"%s adoptstate %s <uuid>|<name> <state_file>\n"
"\n", SEP);
if (u64Cmd & USAGE_SNAPSHOT)
RTStrmPrintf(pStrm,
"%s snapshot %s <uuid>|<name>\n"
" take <name> [--description <desc>] [--pause] |\n"
" delete <uuid>|<name> |\n"
" restore <uuid>|<name> |\n"
" restorecurrent |\n"
" edit <uuid>|<name>|--current\n"
" [--name <name>]\n"
" [--description <desc>] |\n"
" list [--details|--machinereadable]\n"
" showvminfo <uuid>|<name>\n"
"\n", SEP);
if (u64Cmd & USAGE_CLOSEMEDIUM)
RTStrmPrintf(pStrm,
"%s closemedium %s disk|dvd|floppy <uuid>|<filename>\n"
" [--delete]\n"
"\n", SEP);
if (u64Cmd & USAGE_STORAGEATTACH)
RTStrmPrintf(pStrm,
"%s storageattach %s <uuid|vmname>\n"
" --storagectl <name>\n"
" [--port <number>]\n"
" [--device <number>]\n"
" [--type dvddrive|hdd|fdd]\n"
" [--medium none|emptydrive|additions|\n"
" <uuid>|<filename>|host:<drive>|iscsi]\n"
" [--mtype normal|writethrough|immutable|shareable|\n"
" readonly|multiattach]\n"
" [--comment <text>]\n"
" [--setuuid <uuid>]\n"
" [--setparentuuid <uuid>]\n"
" [--passthrough on|off]\n"
" [--tempeject on|off]\n"
" [--nonrotational on|off]\n"
" [--discard on|off]\n"
" [--bandwidthgroup <name>]\n"
" [--forceunmount]\n"
" [--server <name>|<ip>]\n"
" [--target <target>]\n"
" [--tport <port>]\n"
" [--lun <lun>]\n"
" [--encodedlun <lun>]\n"
" [--username <username>]\n"
" [--password <password>]\n"
" [--initiator <initiator>]\n"
" [--intnet]\n"
"\n", SEP);
if (u64Cmd & USAGE_STORAGECONTROLLER)
RTStrmPrintf(pStrm,
"%s storagectl %s <uuid|vmname>\n"
" --name <name>\n"
" [--add ide|sata|scsi|floppy|sas]\n"
" [--controller LSILogic|LSILogicSAS|BusLogic|\n"
" IntelAHCI|PIIX3|PIIX4|ICH6|I82078]\n"
" [--sataportcount <1-30>]\n"
" [--hostiocache on|off]\n"
" [--bootable on|off]\n"
" [--remove]\n"
"\n", SEP);
if (u64Cmd & USAGE_BANDWIDTHCONTROL)
RTStrmPrintf(pStrm,
"%s bandwidthctl %s <uuid|vmname>\n"
" add <name> --type disk|network\n"
" --limit <megabytes per second>[k|m|g|K|M|G] |\n"
" set <name>\n"
" --limit <megabytes per second>[k|m|g|K|M|G] |\n"
" remove <name> |\n"
" list [--machinereadable]\n"
" (limit units: k=kilobit, m=megabit, g=gigabit,\n"
" K=kilobyte, M=megabyte, G=gigabyte)\n"
"\n", SEP);
if (u64Cmd & USAGE_SHOWHDINFO)
RTStrmPrintf(pStrm,
"%s showhdinfo %s <uuid>|<filename>\n"
"\n", SEP);
if (u64Cmd & USAGE_CREATEHD)
RTStrmPrintf(pStrm,
"%s createhd %s --filename <filename>\n"
" [--size <megabytes>|--sizebyte <bytes>]\n"
" [--diffparent <uuid>|<filename>\n"
" [--format VDI|VMDK|VHD] (default: VDI)\n"
" [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
"\n", SEP);
if (u64Cmd & USAGE_MODIFYHD)
RTStrmPrintf(pStrm,
"%s modifyhd %s <uuid>|<filename>\n"
" [--type normal|writethrough|immutable|shareable|\n"
" readonly|multiattach]\n"
" [--autoreset on|off]\n"
" [--compact]\n"
" [--resize <megabytes>|--resizebyte <bytes>]\n"
"\n", SEP);
if (u64Cmd & USAGE_CLONEHD)
RTStrmPrintf(pStrm,
"%s clonehd %s <uuid>|<filename> <uuid>|<outputfile>\n"
" [--format VDI|VMDK|VHD|RAW|<other>]\n"
" [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
" [--existing]\n"
"\n", SEP);
if (u64Cmd & USAGE_CONVERTFROMRAW)
RTStrmPrintf(pStrm,
"%s convertfromraw %s <filename> <outputfile>\n"
" [--format VDI|VMDK|VHD]\n"
" [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
" [--uuid <uuid>]\n"
"%s convertfromraw %s stdin <outputfile> <bytes>\n"
" [--format VDI|VMDK|VHD]\n"
" [--variant Standard,Fixed,Split2G,Stream,ESX]\n"
" [--uuid <uuid>]\n"
"\n", SEP, SEP);
if (u64Cmd & USAGE_GETEXTRADATA)
RTStrmPrintf(pStrm,
"%s getextradata %s global|<uuid>|<name>\n"
" <key>|enumerate\n"
"\n", SEP);
if (u64Cmd & USAGE_SETEXTRADATA)
RTStrmPrintf(pStrm,
"%s setextradata %s global|<uuid>|<name>\n"
" <key>\n"
" [<value>] (no value deletes key)\n"
"\n", SEP);
if (u64Cmd & USAGE_SETPROPERTY)
RTStrmPrintf(pStrm,
"%s setproperty %s machinefolder default|<folder> |\n"
" vrdeauthlibrary default|<library> |\n"
" websrvauthlibrary default|null|<library> |\n"
" vrdeextpack null|<library> |\n"
" autostartdbpath null|<folder> |\n"
" loghistorycount <value>\n"
"\n", SEP);
if (u64Cmd & USAGE_USBFILTER_ADD)
RTStrmPrintf(pStrm,
"%s usbfilter %s add <index,0-N>\n"
" --target <uuid>|<name>|global\n"
" --name <string>\n"
" --action ignore|hold (global filters only)\n"
" [--active yes|no] (yes)\n"
" [--vendorid <XXXX>] (null)\n"
" [--productid <XXXX>] (null)\n"
" [--revision <IIFF>] (null)\n"
" [--manufacturer <string>] (null)\n"
" [--product <string>] (null)\n"
" [--remote yes|no] (null, VM filters only)\n"
" [--serialnumber <string>] (null)\n"
" [--maskedinterfaces <XXXXXXXX>]\n"
"\n", SEP);
if (u64Cmd & USAGE_USBFILTER_MODIFY)
RTStrmPrintf(pStrm,
"%s usbfilter %s modify <index,0-N>\n"
" --target <uuid>|<name>|global\n"
" [--name <string>]\n"
" [--action ignore|hold] (global filters only)\n"
" [--active yes|no]\n"
" [--vendorid <XXXX>|\"\"]\n"
" [--productid <XXXX>|\"\"]\n"
" [--revision <IIFF>|\"\"]\n"
" [--manufacturer <string>|\"\"]\n"
" [--product <string>|\"\"]\n"
" [--remote yes|no] (null, VM filters only)\n"
" [--serialnumber <string>|\"\"]\n"
" [--maskedinterfaces <XXXXXXXX>]\n"
"\n", SEP);
if (u64Cmd & USAGE_USBFILTER_REMOVE)
RTStrmPrintf(pStrm,
"%s usbfilter %s remove <index,0-N>\n"
" --target <uuid>|<name>|global\n"
"\n", SEP);
if (u64Cmd & USAGE_SHAREDFOLDER_ADD)
RTStrmPrintf(pStrm,
"%s sharedfolder %s add <vmname>|<uuid>\n"
" --name <name> --hostpath <hostpath>\n"
" [--transient] [--readonly] [--automount]\n"
"\n", SEP);
if (u64Cmd & USAGE_SHAREDFOLDER_REMOVE)
RTStrmPrintf(pStrm,
"%s sharedfolder %s remove <vmname>|<uuid>\n"
" --name <name> [--transient]\n"
"\n", SEP);
#ifdef VBOX_WITH_GUEST_PROPS
if (u64Cmd & USAGE_GUESTPROPERTY)
usageGuestProperty(pStrm, SEP);
#endif /* VBOX_WITH_GUEST_PROPS defined */
#ifdef VBOX_WITH_GUEST_CONTROL
if (u64Cmd & USAGE_GUESTCONTROL)
usageGuestControl(pStrm, SEP);
#endif /* VBOX_WITH_GUEST_CONTROL defined */
if (u64Cmd & USAGE_DEBUGVM)
{
RTStrmPrintf(pStrm,
"%s debugvm %s <uuid>|<name>\n"
" dumpguestcore --filename <name> |\n"
" info <item> [args] |\n"
" injectnmi |\n"
" log [--release|--debug] <settings> ...|\n"
" logdest [--release|--debug] <settings> ...|\n"
" logflags [--release|--debug] <settings> ...|\n"
" osdetect |\n"
" osinfo |\n"
" getregisters [--cpu <id>] <reg>|all ... |\n"
" setregisters [--cpu <id>] <reg>=<value> ... |\n"
" show [--human-readable|--sh-export|--sh-eval|\n"
" --cmd-set] \n"
" <logdbg-settings|logrel-settings>\n"
" [[opt] what ...] |\n"
" statistics [--reset] [--pattern <pattern>]\n"
" [--descriptions]\n"
"\n", SEP);
}
if (u64Cmd & USAGE_METRICS)
RTStrmPrintf(pStrm,
"%s metrics %s list [*|host|<vmname> [<metric_list>]]\n"
" (comma-separated)\n\n"
"%s metrics %s setup\n"
" [--period <seconds>] (default: 1)\n"
" [--samples <count>] (default: 1)\n"
" [--list]\n"
" [*|host|<vmname> [<metric_list>]]\n\n"
"%s metrics %s query [*|host|<vmname> [<metric_list>]]\n\n"
"%s metrics %s enable\n"
" [--list]\n"
" [*|host|<vmname> [<metric_list>]]\n\n"
"%s metrics %s disable\n"
" [--list]\n"
" [*|host|<vmname> [<metric_list>]]\n\n"
"%s metrics %s collect\n"
" [--period <seconds>] (default: 1)\n"
" [--samples <count>] (default: 1)\n"
" [--list]\n"
" [--detach]\n"
" [*|host|<vmname> [<metric_list>]]\n"
"\n", SEP, SEP, SEP, SEP, SEP, SEP);
#if defined(VBOX_WITH_NETFLT)
if (u64Cmd & USAGE_HOSTONLYIFS)
{
RTStrmPrintf(pStrm,
"%s hostonlyif %s ipconfig <name>\n"
" [--dhcp |\n"
" --ip<ipv4> [--netmask<ipv4> (def: 255.255.255.0)] |\n"
" --ipv6<ipv6> [--netmasklengthv6<length> (def: 64)]]\n"
# if !defined(RT_OS_SOLARIS)
" create |\n"
" remove <name>\n"
# endif
"\n", SEP);
}
#endif
if (u64Cmd & USAGE_DHCPSERVER)
{
RTStrmPrintf(pStrm,
"%s dhcpserver %s add|modify --netname <network_name> |\n"
#if defined(VBOX_WITH_NETFLT)
" --ifname <hostonly_if_name>\n"
#endif
" [--ip <ip_address>\n"
" --netmask <network_mask>\n"
" --lowerip <lower_ip>\n"
" --upperip <upper_ip>]\n"
" [--enable | --disable]\n\n"
"%s dhcpserver %s remove --netname <network_name> |\n"
#if defined(VBOX_WITH_NETFLT)
" --ifname <hostonly_if_name>\n"
#endif
"\n", SEP, SEP);
}
if (u64Cmd & USAGE_EXTPACK)
{
RTStrmPrintf(pStrm,
"%s extpack %s install [--replace] <tarball> |\n"
" uninstall [--force] <name> |\n"
" cleanup\n"
"\n", SEP);
}
}
/**
* Print a usage synopsis and the syntax error message.
* @returns RTEXITCODE_SYNTAX.
*/
RTEXITCODE errorSyntax(USAGECATEGORY u64Cmd, const char *pszFormat, ...)
{
va_list args;
showLogo(g_pStdErr); // show logo even if suppressed
#ifndef VBOX_ONLY_DOCS
if (g_fInternalMode)
printUsageInternal(u64Cmd, g_pStdErr);
else
printUsage(u64Cmd, g_pStdErr);
#endif /* !VBOX_ONLY_DOCS */
va_start(args, pszFormat);
RTStrmPrintf(g_pStdErr, "\nSyntax error: %N\n", pszFormat, &args);
va_end(args);
return RTEXITCODE_SYNTAX;
}
/**
* errorSyntax for RTGetOpt users.
*
* @returns RTEXITCODE_SYNTAX.
*
* @param fUsageCategory The usage category of the command.
* @param rc The RTGetOpt return code.
* @param pValueUnion The value union.
*/
RTEXITCODE errorGetOpt(USAGECATEGORY fUsageCategory, int rc, union RTGETOPTUNION const *pValueUnion)
{
/*
* Check if it is an unhandled standard option.
*/
if (rc == 'V')
{
RTPrintf("%sr%d\n", VBOX_VERSION_STRING, RTBldCfgRevision());
return RTEXITCODE_SUCCESS;
}
if (rc == 'h')
{
showLogo(g_pStdErr);
#ifndef VBOX_ONLY_DOCS
if (g_fInternalMode)
printUsageInternal(fUsageCategory, g_pStdOut);
else
printUsage(fUsageCategory, g_pStdOut);
#endif
return RTEXITCODE_SUCCESS;
}
/*
* General failure.
*/
showLogo(g_pStdErr); // show logo even if suppressed
#ifndef VBOX_ONLY_DOCS
if (g_fInternalMode)
printUsageInternal(fUsageCategory, g_pStdErr);
else
printUsage(fUsageCategory, g_pStdErr);
#endif /* !VBOX_ONLY_DOCS */
if (rc == VINF_GETOPT_NOT_OPTION)
return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Invalid parameter '%s'", pValueUnion->psz);
if (rc > 0)
{
if (RT_C_IS_PRINT(rc))
return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Invalid option -%c", rc);
return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Invalid option case %i", rc);
}
if (rc == VERR_GETOPT_UNKNOWN_OPTION)
return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Unknown option: %s", pValueUnion->psz);
if (rc == VERR_GETOPT_INVALID_ARGUMENT_FORMAT)
return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Invalid argument format: %s", pValueUnion->psz);
if (pValueUnion->pDef)
return RTMsgErrorExit(RTEXITCODE_SYNTAX, "%s: %Rrs", pValueUnion->pDef->pszLong, rc);
return RTMsgErrorExit(RTEXITCODE_SYNTAX, "%Rrs", rc);
}
/**
* Print an error message without the syntax stuff.
*
* @returns RTEXITCODE_SYNTAX.
*/
RTEXITCODE errorArgument(const char *pszFormat, ...)
{
va_list args;
va_start(args, pszFormat);
RTMsgErrorV(pszFormat, args);
va_end(args);
return RTEXITCODE_SYNTAX;
}