/* $Id: VBoxManageHelp.cpp 52312 2014-08-07 12:54:38Z vboxsync $ */ /** @file * VBoxManage - help and other message output. */ /* * Copyright (C) 2006-2014 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of the GNU * General Public License (GPL) as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ /******************************************************************************* * Header Files * *******************************************************************************/ #include #include #include #include #include #include #include "VBoxManage.h" void showLogo(PRTSTREAM pStrm) { static bool s_fShown; /* show only once */ if (!s_fShown) { RTStrmPrintf(pStrm, VBOX_PRODUCT " Command Line Management Interface Version " VBOX_VERSION_STRING "\n" "(C) 2005-" VBOX_C_YEAR " " VBOX_VENDOR "\n" "All rights reserved.\n" "\n"); s_fShown = true; } } void printUsage(USAGECATEGORY fCategory, uint32_t fSubCategory, PRTSTREAM pStrm) { bool fDumpOpts = false; #ifdef RT_OS_LINUX bool fLinux = true; #else bool fLinux = false; #endif #ifdef RT_OS_WINDOWS bool fWin = true; #else bool fWin = false; #endif #ifdef RT_OS_SOLARIS bool fSolaris = true; #else bool fSolaris = false; #endif #ifdef RT_OS_FREEBSD bool fFreeBSD = true; #else bool fFreeBSD = false; #endif #ifdef RT_OS_DARWIN bool fDarwin = true; #else bool fDarwin = false; #endif #ifdef VBOX_WITH_VBOXSDL bool fVBoxSDL = true; #else bool fVBoxSDL = false; #endif if (fCategory == USAGE_DUMPOPTS) { fDumpOpts = true; fLinux = true; fWin = true; fSolaris = true; fFreeBSD = true; fDarwin = true; fVBoxSDL = true; fCategory = USAGE_ALL; } RTStrmPrintf(pStrm, "Usage:\n" "\n"); if (fCategory == USAGE_ALL) RTStrmPrintf(pStrm, " VBoxManage [] \n" " \n \n" "General Options:\n \n" " [-v|--version] print version number and exit\n" " [-q|--nologo] suppress the logo\n" " [--settingspw ] provide the settings password\n" " [--settingspwfile ] provide a file containing the settings password\n" " \n \n" "Commands:\n \n"); const char *pcszSep1 = " "; const char *pcszSep2 = " "; if (fCategory != USAGE_ALL) { pcszSep1 = "VBoxManage"; pcszSep2 = ""; } #define SEP pcszSep1, pcszSep2 if (fCategory & USAGE_LIST) RTStrmPrintf(pStrm, "%s list [--long|-l]%s vms|runningvms|ostypes|hostdvds|hostfloppies|\n" #if defined(VBOX_WITH_NETFLT) " intnets|bridgedifs|hostonlyifs|natnets|dhcpservers|\n" #else " intnets|bridgedifs|natnets|dhcpservers|hostinfo|\n" #endif " hostinfo|hostcpuids|hddbackends|hdds|dvds|floppies|\n" " usbhost|usbfilters|systemproperties|extpacks|\n" " groups|webcams|screenshotformats\n" "\n", SEP); if (fCategory & USAGE_SHOWVMINFO) RTStrmPrintf(pStrm, "%s showvminfo %s [--details]\n" " [--machinereadable]\n" "%s showvminfo %s --log \n" "\n", SEP, SEP); if (fCategory & USAGE_REGISTERVM) RTStrmPrintf(pStrm, "%s registervm %s \n" "\n", SEP); if (fCategory & USAGE_UNREGISTERVM) RTStrmPrintf(pStrm, "%s unregistervm %s [--delete]\n" "\n", SEP); if (fCategory & USAGE_CREATEVM) RTStrmPrintf(pStrm, "%s createvm %s --name \n" " [--groups , ...]\n" " [--ostype ]\n" " [--register]\n" " [--basefolder ]\n" " [--uuid ]\n" "\n", SEP); if (fCategory & USAGE_MODIFYVM) { RTStrmPrintf(pStrm, "%s modifyvm %s \n" " [--name ]\n" " [--groups , ...]\n" " [--description ]\n" " [--ostype ]\n" " [--iconfile ]\n" " [--memory ]\n" " [--pagefusion on|off]\n" " [--vram ]\n" " [--acpi on|off]\n" #ifdef VBOX_WITH_PCI_PASSTHROUGH " [--pciattach 03:04.0]\n" " [--pciattach 03:04.0@02:01.0]\n" " [--pcidetach 03:04.0]\n" #endif " [--ioapic on|off]\n" " [--hpet on|off]\n" " [--triplefaultreset on|off]\n" " [--paravirtprovider none|default|legacy|minimal|\n" " hyperv]\n" " [--hwvirtex on|off]\n" " [--nestedpaging on|off]\n" " [--largepages on|off]\n" " [--vtxvpid on|off]\n" " [--vtxux on|off]\n" " [--pae on|off]\n" " [--longmode on|off]\n" " [--synthcpu on|off]\n" " [--cpuidset ]\n" " [--cpuidremove ]\n" " [--cpuidremoveall]\n" " [--hardwareuuid ]\n" " [--cpus ]\n" " [--cpuhotplug on|off]\n" " [--plugcpu ]\n" " [--unplugcpu ]\n" " [--cpuexecutioncap <1-100>]\n" " [--rtcuseutc on|off]\n" #ifdef VBOX_WITH_VMSVGA " [--graphicscontroller none|vboxvga|vmsvga]\n" #else " [--graphicscontroller none|vboxvga]\n" #endif " [--monitorcount ]\n" " [--accelerate3d on|off]\n" #ifdef VBOX_WITH_VIDEOHWACCEL " [--accelerate2dvideo on|off]\n" #endif " [--firmware bios|efi|efi32|efi64]\n" " [--chipset ich9|piix3]\n" " [--bioslogofadein on|off]\n" " [--bioslogofadeout on|off]\n" " [--bioslogodisplaytime ]\n" " [--bioslogoimagepath ]\n" " [--biosbootmenu disabled|menuonly|messageandmenu]\n" " [--biossystemtimeoffset ]\n" " [--biospxedebug on|off]\n" " [--boot<1-4> none|floppy|dvd|disk|net>]\n" " [--nic<1-N> none|null|nat|bridged|intnet" #if defined(VBOX_WITH_NETFLT) "|hostonly" #endif "|\n" " generic|natnetwork" "]\n" " [--nictype<1-N> Am79C970A|Am79C973" #ifdef VBOX_WITH_E1000 "|\n 82540EM|82543GC|82545EM" #endif #ifdef VBOX_WITH_VIRTIO "|\n virtio" #endif /* VBOX_WITH_VIRTIO */ "]\n" " [--cableconnected<1-N> on|off]\n" " [--nictrace<1-N> on|off]\n" " [--nictracefile<1-N> ]\n" " [--nicproperty<1-N> name=[value]]\n" " [--nicspeed<1-N> ]\n" " [--nicbootprio<1-N> ]\n" " [--nicpromisc<1-N> deny|allow-vms|allow-all]\n" " [--nicbandwidthgroup<1-N> none|]\n" " [--bridgeadapter<1-N> none|]\n" #if defined(VBOX_WITH_NETFLT) " [--hostonlyadapter<1-N> none|]\n" #endif " [--intnet<1-N> ]\n" " [--nat-network<1-N> ]\n" " [--nicgenericdrv<1-N> \n" " [--natnet<1-N> |default]\n" " [--natsettings<1-N> [],[],\n" " [],[],\n" " []]\n" " [--natpf<1-N> [],tcp|udp,[],\n" " ,[],]\n" " [--natpf<1-N> delete ]\n" " [--nattftpprefix<1-N> ]\n" " [--nattftpfile<1-N> ]\n" " [--nattftpserver<1-N> ]\n" " [--natbindip<1-N> \n" " [--natdnspassdomain<1-N> on|off]\n" " [--natdnsproxy<1-N> on|off]\n" " [--natdnshostresolver<1-N> on|off]\n" " [--nataliasmode<1-N> default|[log],[proxyonly],\n" " [sameports]]\n" " [--macaddress<1-N> auto|]\n" " [--mouse ps2|usb|usbtablet|usbmultitouch]\n" " [--keyboard ps2|usb\n" " [--uart<1-N> off| ]\n" " [--uartmode<1-N> disconnected|\n" " server |\n" " client |\n" " file |\n" " ]\n" #if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) " [--lpt<1-N> off| ]\n" " [--lptmode<1-N> ]\n" #endif " [--guestmemoryballoon ]\n" " [--audio none|null", SEP); if (fWin) { #ifdef VBOX_WITH_WINMM RTStrmPrintf(pStrm, "|winmm|dsound"); #else RTStrmPrintf(pStrm, "|dsound"); #endif } if (fSolaris) { RTStrmPrintf(pStrm, "|solaudio" #ifdef VBOX_WITH_SOLARIS_OSS "|oss" #endif ); } if (fLinux) { RTStrmPrintf(pStrm, "|oss" #ifdef VBOX_WITH_ALSA "|alsa" #endif #ifdef VBOX_WITH_PULSE "|pulse" #endif ); } if (fFreeBSD) { /* Get the line break sorted when dumping all option variants. */ if (fDumpOpts) { RTStrmPrintf(pStrm, "|\n" " oss"); } else RTStrmPrintf(pStrm, "|oss"); #ifdef VBOX_WITH_PULSE RTStrmPrintf(pStrm, "|pulse"); #endif } if (fDarwin) { RTStrmPrintf(pStrm, "|coreaudio"); } RTStrmPrintf(pStrm, "]\n"); RTStrmPrintf(pStrm, " [--audiocontroller ac97|hda|sb16]\n" " [--clipboard disabled|hosttoguest|guesttohost|\n" " bidirectional]\n" " [--draganddrop disabled|hosttoguest]\n"); RTStrmPrintf(pStrm, " [--vrde on|off]\n" " [--vrdeextpack default|\n" " [--vrdeproperty ]\n" " [--vrdeport ]\n" " [--vrdeaddress ]\n" " [--vrdeauthtype null|external|guest]\n" " [--vrdeauthlibrary default|\n" " [--vrdemulticon on|off]\n" " [--vrdereusecon on|off]\n" " [--vrdevideochannel on|off]\n" " [--vrdevideochannelquality ]\n"); RTStrmPrintf(pStrm, " [--usb on|off]\n" " [--usbehci on|off]\n" " [--snapshotfolder default|]\n" " [--teleporter on|off]\n" " [--teleporterport ]\n" " [--teleporteraddress \n" " [--teleporterpassword ]\n" " [--teleporterpasswordfile |stdin]\n" " [--tracing-enabled on|off]\n" " [--tracing-config ]\n" " [--tracing-allow-vm-access on|off]\n" #if 0 " [--iocache on|off]\n" " [--iocachesize ]\n" #endif #if 0 " [--faulttolerance master|standby]\n" " [--faulttoleranceaddress ]\n" " [--faulttoleranceport ]\n" " [--faulttolerancesyncinterval ]\n" " [--faulttolerancepassword ]\n" #endif #ifdef VBOX_WITH_USB_CARDREADER " [--usbcardreader on|off]\n" #endif " [--autostart-enabled on|off]\n" " [--autostart-delay ]\n" #if 0 /* Disabled until the feature is implemented. */ " [--autostop-type disabled|savestate|poweroff|\n" " acpishutdown]\n" #endif #ifdef VBOX_WITH_VPX " [--vcpenabled on|off]\n" " [--vcpscreens [],...\n" " [--vcpfile ]\n" " [--vcpwidth ]\n" " [--vcpheight ]\n" " [--vcprate ]\n" " [--vcpfps ]\n" " [--vcpmaxtime