qemu-options.hx 161 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159
  1. HXCOMM Use DEFHEADING() to define headings in both help text and texi
  2. HXCOMM Text between STEXI and ETEXI are copied to texi version and
  3. HXCOMM discarded from C version
  4. HXCOMM DEF(option, HAS_ARG/0, opt_enum, opt_help, arch_mask) is used to
  5. HXCOMM construct option structures, enums and help message for specified
  6. HXCOMM architectures.
  7. HXCOMM HXCOMM can be used for comments, discarded from both texi and C
  8. DEFHEADING(Standard options)
  9. STEXI
  10. @table @option
  11. ETEXI
  12. DEF("help", 0, QEMU_OPTION_h,
  13. "-h or -help display this help and exit\n", QEMU_ARCH_ALL)
  14. STEXI
  15. @item -h
  16. @findex -h
  17. Display help and exit
  18. ETEXI
  19. DEF("version", 0, QEMU_OPTION_version,
  20. "-version display version information and exit\n", QEMU_ARCH_ALL)
  21. STEXI
  22. @item -version
  23. @findex -version
  24. Display version information and exit
  25. ETEXI
  26. DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
  27. "-machine [type=]name[,prop[=value][,...]]\n"
  28. " selects emulated machine ('-machine help' for list)\n"
  29. " property accel=accel1[:accel2[:...]] selects accelerator\n"
  30. " supported accelerators are kvm, xen, tcg (default: tcg)\n"
  31. " kernel_irqchip=on|off|split controls accelerated irqchip support (default=off)\n"
  32. " vmport=on|off|auto controls emulation of vmport (default: auto)\n"
  33. " kvm_shadow_mem=size of KVM shadow MMU in bytes\n"
  34. " dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
  35. " mem-merge=on|off controls memory merge support (default: on)\n"
  36. " igd-passthru=on|off controls IGD GFX passthrough support (default=off)\n"
  37. " aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n"
  38. " dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n"
  39. " suppress-vmdesc=on|off disables self-describing migration (default=off)\n"
  40. " nvdimm=on|off controls NVDIMM support (default=off)\n"
  41. " enforce-config-section=on|off enforce configuration section migration (default=off)\n",
  42. QEMU_ARCH_ALL)
  43. STEXI
  44. @item -machine [type=]@var{name}[,prop=@var{value}[,...]]
  45. @findex -machine
  46. Select the emulated machine by @var{name}. Use @code{-machine help} to list
  47. available machines. Supported machine properties are:
  48. @table @option
  49. @item accel=@var{accels1}[:@var{accels2}[:...]]
  50. This is used to enable an accelerator. Depending on the target architecture,
  51. kvm, xen, or tcg can be available. By default, tcg is used. If there is more
  52. than one accelerator specified, the next one is used if the previous one fails
  53. to initialize.
  54. @item kernel_irqchip=on|off
  55. Controls in-kernel irqchip support for the chosen accelerator when available.
  56. @item gfx_passthru=on|off
  57. Enables IGD GFX passthrough support for the chosen machine when available.
  58. @item vmport=on|off|auto
  59. Enables emulation of VMWare IO port, for vmmouse etc. auto says to select the
  60. value based on accel. For accel=xen the default is off otherwise the default
  61. is on.
  62. @item kvm_shadow_mem=size
  63. Defines the size of the KVM shadow MMU.
  64. @item dump-guest-core=on|off
  65. Include guest memory in a core dump. The default is on.
  66. @item mem-merge=on|off
  67. Enables or disables memory merge support. This feature, when supported by
  68. the host, de-duplicates identical memory pages among VMs instances
  69. (enabled by default).
  70. @item aes-key-wrap=on|off
  71. Enables or disables AES key wrapping support on s390-ccw hosts. This feature
  72. controls whether AES wrapping keys will be created to allow
  73. execution of AES cryptographic functions. The default is on.
  74. @item dea-key-wrap=on|off
  75. Enables or disables DEA key wrapping support on s390-ccw hosts. This feature
  76. controls whether DEA wrapping keys will be created to allow
  77. execution of DEA cryptographic functions. The default is on.
  78. @item nvdimm=on|off
  79. Enables or disables NVDIMM support. The default is off.
  80. @end table
  81. ETEXI
  82. HXCOMM Deprecated by -machine
  83. DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
  84. DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
  85. "-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
  86. STEXI
  87. @item -cpu @var{model}
  88. @findex -cpu
  89. Select CPU model (@code{-cpu help} for list and additional feature selection)
  90. ETEXI
  91. DEF("accel", HAS_ARG, QEMU_OPTION_accel,
  92. "-accel [accel=]accelerator[,thread=single|multi]\n"
  93. " select accelerator ('-accel help for list')\n"
  94. " thread=single|multi (enable multi-threaded TCG)", QEMU_ARCH_ALL)
  95. STEXI
  96. @item -accel @var{name}[,prop=@var{value}[,...]]
  97. @findex -accel
  98. This is used to enable an accelerator. Depending on the target architecture,
  99. kvm, xen, or tcg can be available. By default, tcg is used. If there is more
  100. than one accelerator specified, the next one is used if the previous one fails
  101. to initialize.
  102. @table @option
  103. @item thread=single|multi
  104. Controls number of TCG threads. When the TCG is multi-threaded there will be one
  105. thread per vCPU therefor taking advantage of additional host cores. The default
  106. is to enable multi-threading where both the back-end and front-ends support it and
  107. no incompatible TCG features have been enabled (e.g. icount/replay).
  108. @end table
  109. ETEXI
  110. DEF("smp", HAS_ARG, QEMU_OPTION_smp,
  111. "-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets]\n"
  112. " set the number of CPUs to 'n' [default=1]\n"
  113. " maxcpus= maximum number of total cpus, including\n"
  114. " offline CPUs for hotplug, etc\n"
  115. " cores= number of CPU cores on one socket\n"
  116. " threads= number of threads on one CPU core\n"
  117. " sockets= number of discrete sockets in the system\n",
  118. QEMU_ARCH_ALL)
  119. STEXI
  120. @item -smp [cpus=]@var{n}[,cores=@var{cores}][,threads=@var{threads}][,sockets=@var{sockets}][,maxcpus=@var{maxcpus}]
  121. @findex -smp
  122. Simulate an SMP system with @var{n} CPUs. On the PC target, up to 255
  123. CPUs are supported. On Sparc32 target, Linux limits the number of usable CPUs
  124. to 4.
  125. For the PC target, the number of @var{cores} per socket, the number
  126. of @var{threads} per cores and the total number of @var{sockets} can be
  127. specified. Missing values will be computed. If any on the three values is
  128. given, the total number of CPUs @var{n} can be omitted. @var{maxcpus}
  129. specifies the maximum number of hotpluggable CPUs.
  130. ETEXI
  131. DEF("numa", HAS_ARG, QEMU_OPTION_numa,
  132. "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node]\n"
  133. "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node]\n", QEMU_ARCH_ALL)
  134. STEXI
  135. @item -numa node[,mem=@var{size}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}]
  136. @itemx -numa node[,memdev=@var{id}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}]
  137. @findex -numa
  138. Define a NUMA node and assign RAM and VCPUs to it.
  139. @var{firstcpu} and @var{lastcpu} are CPU indexes. Each
  140. @samp{cpus} option represent a contiguous range of CPU indexes
  141. (or a single VCPU if @var{lastcpu} is omitted). A non-contiguous
  142. set of VCPUs can be represented by providing multiple @samp{cpus}
  143. options. If @samp{cpus} is omitted on all nodes, VCPUs are automatically
  144. split between them.
  145. For example, the following option assigns VCPUs 0, 1, 2 and 5 to
  146. a NUMA node:
  147. @example
  148. -numa node,cpus=0-2,cpus=5
  149. @end example
  150. @samp{mem} assigns a given RAM amount to a node. @samp{memdev}
  151. assigns RAM from a given memory backend device to a node. If
  152. @samp{mem} and @samp{memdev} are omitted in all nodes, RAM is
  153. split equally between them.
  154. @samp{mem} and @samp{memdev} are mutually exclusive. Furthermore,
  155. if one node uses @samp{memdev}, all of them have to use it.
  156. Note that the -@option{numa} option doesn't allocate any of the
  157. specified resources, it just assigns existing resources to NUMA
  158. nodes. This means that one still has to use the @option{-m},
  159. @option{-smp} options to allocate RAM and VCPUs respectively.
  160. ETEXI
  161. DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd,
  162. "-add-fd fd=fd,set=set[,opaque=opaque]\n"
  163. " Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL)
  164. STEXI
  165. @item -add-fd fd=@var{fd},set=@var{set}[,opaque=@var{opaque}]
  166. @findex -add-fd
  167. Add a file descriptor to an fd set. Valid options are:
  168. @table @option
  169. @item fd=@var{fd}
  170. This option defines the file descriptor of which a duplicate is added to fd set.
  171. The file descriptor cannot be stdin, stdout, or stderr.
  172. @item set=@var{set}
  173. This option defines the ID of the fd set to add the file descriptor to.
  174. @item opaque=@var{opaque}
  175. This option defines a free-form string that can be used to describe @var{fd}.
  176. @end table
  177. You can open an image using pre-opened file descriptors from an fd set:
  178. @example
  179. qemu-system-i386
  180. -add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
  181. -add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
  182. -drive file=/dev/fdset/2,index=0,media=disk
  183. @end example
  184. ETEXI
  185. DEF("set", HAS_ARG, QEMU_OPTION_set,
  186. "-set group.id.arg=value\n"
  187. " set <arg> parameter for item <id> of type <group>\n"
  188. " i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL)
  189. STEXI
  190. @item -set @var{group}.@var{id}.@var{arg}=@var{value}
  191. @findex -set
  192. Set parameter @var{arg} for item @var{id} of type @var{group}
  193. ETEXI
  194. DEF("global", HAS_ARG, QEMU_OPTION_global,
  195. "-global driver.property=value\n"
  196. "-global driver=driver,property=property,value=value\n"
  197. " set a global default for a driver property\n",
  198. QEMU_ARCH_ALL)
  199. STEXI
  200. @item -global @var{driver}.@var{prop}=@var{value}
  201. @itemx -global driver=@var{driver},property=@var{property},value=@var{value}
  202. @findex -global
  203. Set default value of @var{driver}'s property @var{prop} to @var{value}, e.g.:
  204. @example
  205. qemu-system-i386 -global ide-drive.physical_block_size=4096 -drive file=file,if=ide,index=0,media=disk
  206. @end example
  207. In particular, you can use this to set driver properties for devices which are
  208. created automatically by the machine model. To create a device which is not
  209. created automatically and set properties on it, use -@option{device}.
  210. -global @var{driver}.@var{prop}=@var{value} is shorthand for -global
  211. driver=@var{driver},property=@var{prop},value=@var{value}. The
  212. longhand syntax works even when @var{driver} contains a dot.
  213. ETEXI
  214. DEF("boot", HAS_ARG, QEMU_OPTION_boot,
  215. "-boot [order=drives][,once=drives][,menu=on|off]\n"
  216. " [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n"
  217. " 'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n"
  218. " 'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n"
  219. " 'sp_time': the period that splash picture last if menu=on, unit is ms\n"
  220. " 'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n",
  221. QEMU_ARCH_ALL)
  222. STEXI
  223. @item -boot [order=@var{drives}][,once=@var{drives}][,menu=on|off][,splash=@var{sp_name}][,splash-time=@var{sp_time}][,reboot-timeout=@var{rb_timeout}][,strict=on|off]
  224. @findex -boot
  225. Specify boot order @var{drives} as a string of drive letters. Valid
  226. drive letters depend on the target architecture. The x86 PC uses: a, b
  227. (floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p (Etherboot
  228. from network adapter 1-4), hard disk boot is the default. To apply a
  229. particular boot order only on the first startup, specify it via
  230. @option{once}. Note that the @option{order} or @option{once} parameter
  231. should not be used together with the @option{bootindex} property of
  232. devices, since the firmware implementations normally do not support both
  233. at the same time.
  234. Interactive boot menus/prompts can be enabled via @option{menu=on} as far
  235. as firmware/BIOS supports them. The default is non-interactive boot.
  236. A splash picture could be passed to bios, enabling user to show it as logo,
  237. when option splash=@var{sp_name} is given and menu=on, If firmware/BIOS
  238. supports them. Currently Seabios for X86 system support it.
  239. limitation: The splash file could be a jpeg file or a BMP file in 24 BPP
  240. format(true color). The resolution should be supported by the SVGA mode, so
  241. the recommended is 320x240, 640x480, 800x640.
  242. A timeout could be passed to bios, guest will pause for @var{rb_timeout} ms
  243. when boot failed, then reboot. If @var{rb_timeout} is '-1', guest will not
  244. reboot, qemu passes '-1' to bios by default. Currently Seabios for X86
  245. system support it.
  246. Do strict boot via @option{strict=on} as far as firmware/BIOS
  247. supports it. This only effects when boot priority is changed by
  248. bootindex options. The default is non-strict boot.
  249. @example
  250. # try to boot from network first, then from hard disk
  251. qemu-system-i386 -boot order=nc
  252. # boot from CD-ROM first, switch back to default order after reboot
  253. qemu-system-i386 -boot once=d
  254. # boot with a splash picture for 5 seconds.
  255. qemu-system-i386 -boot menu=on,splash=/root/boot.bmp,splash-time=5000
  256. @end example
  257. Note: The legacy format '-boot @var{drives}' is still supported but its
  258. use is discouraged as it may be removed from future versions.
  259. ETEXI
  260. DEF("m", HAS_ARG, QEMU_OPTION_m,
  261. "-m [size=]megs[,slots=n,maxmem=size]\n"
  262. " configure guest RAM\n"
  263. " size: initial amount of guest memory\n"
  264. " slots: number of hotplug slots (default: none)\n"
  265. " maxmem: maximum amount of guest memory (default: none)\n"
  266. "NOTE: Some architectures might enforce a specific granularity\n",
  267. QEMU_ARCH_ALL)
  268. STEXI
  269. @item -m [size=]@var{megs}[,slots=n,maxmem=size]
  270. @findex -m
  271. Sets guest startup RAM size to @var{megs} megabytes. Default is 128 MiB.
  272. Optionally, a suffix of ``M'' or ``G'' can be used to signify a value in
  273. megabytes or gigabytes respectively. Optional pair @var{slots}, @var{maxmem}
  274. could be used to set amount of hotpluggable memory slots and maximum amount of
  275. memory. Note that @var{maxmem} must be aligned to the page size.
  276. For example, the following command-line sets the guest startup RAM size to
  277. 1GB, creates 3 slots to hotplug additional memory and sets the maximum
  278. memory the guest can reach to 4GB:
  279. @example
  280. qemu-system-x86_64 -m 1G,slots=3,maxmem=4G
  281. @end example
  282. If @var{slots} and @var{maxmem} are not specified, memory hotplug won't
  283. be enabled and the guest startup RAM will never increase.
  284. ETEXI
  285. DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath,
  286. "-mem-path FILE provide backing storage for guest RAM\n", QEMU_ARCH_ALL)
  287. STEXI
  288. @item -mem-path @var{path}
  289. @findex -mem-path
  290. Allocate guest RAM from a temporarily created file in @var{path}.
  291. ETEXI
  292. DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc,
  293. "-mem-prealloc preallocate guest memory (use with -mem-path)\n",
  294. QEMU_ARCH_ALL)
  295. STEXI
  296. @item -mem-prealloc
  297. @findex -mem-prealloc
  298. Preallocate memory when using -mem-path.
  299. ETEXI
  300. DEF("k", HAS_ARG, QEMU_OPTION_k,
  301. "-k language use keyboard layout (for example 'fr' for French)\n",
  302. QEMU_ARCH_ALL)
  303. STEXI
  304. @item -k @var{language}
  305. @findex -k
  306. Use keyboard layout @var{language} (for example @code{fr} for
  307. French). This option is only needed where it is not easy to get raw PC
  308. keycodes (e.g. on Macs, with some X11 servers or with a VNC or curses
  309. display). You don't normally need to use it on PC/Linux or PC/Windows
  310. hosts.
  311. The available layouts are:
  312. @example
  313. ar de-ch es fo fr-ca hu ja mk no pt-br sv
  314. da en-gb et fr fr-ch is lt nl pl ru th
  315. de en-us fi fr-be hr it lv nl-be pt sl tr
  316. @end example
  317. The default is @code{en-us}.
  318. ETEXI
  319. DEF("audio-help", 0, QEMU_OPTION_audio_help,
  320. "-audio-help print list of audio drivers and their options\n",
  321. QEMU_ARCH_ALL)
  322. STEXI
  323. @item -audio-help
  324. @findex -audio-help
  325. Will show the audio subsystem help: list of drivers, tunable
  326. parameters.
  327. ETEXI
  328. DEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw,
  329. "-soundhw c1,... enable audio support\n"
  330. " and only specified sound cards (comma separated list)\n"
  331. " use '-soundhw help' to get the list of supported cards\n"
  332. " use '-soundhw all' to enable all of them\n", QEMU_ARCH_ALL)
  333. STEXI
  334. @item -soundhw @var{card1}[,@var{card2},...] or -soundhw all
  335. @findex -soundhw
  336. Enable audio and selected sound hardware. Use 'help' to print all
  337. available sound hardware.
  338. @example
  339. qemu-system-i386 -soundhw sb16,adlib disk.img
  340. qemu-system-i386 -soundhw es1370 disk.img
  341. qemu-system-i386 -soundhw ac97 disk.img
  342. qemu-system-i386 -soundhw hda disk.img
  343. qemu-system-i386 -soundhw all disk.img
  344. qemu-system-i386 -soundhw help
  345. @end example
  346. Note that Linux's i810_audio OSS kernel (for AC97) module might
  347. require manually specifying clocking.
  348. @example
  349. modprobe i810_audio clocking=48000
  350. @end example
  351. ETEXI
  352. DEF("balloon", HAS_ARG, QEMU_OPTION_balloon,
  353. "-balloon none disable balloon device\n"
  354. "-balloon virtio[,addr=str]\n"
  355. " enable virtio balloon device (default)\n", QEMU_ARCH_ALL)
  356. STEXI
  357. @item -balloon none
  358. @findex -balloon
  359. Disable balloon device.
  360. @item -balloon virtio[,addr=@var{addr}]
  361. Enable virtio balloon device (default), optionally with PCI address
  362. @var{addr}.
  363. ETEXI
  364. DEF("device", HAS_ARG, QEMU_OPTION_device,
  365. "-device driver[,prop[=value][,...]]\n"
  366. " add device (based on driver)\n"
  367. " prop=value,... sets driver properties\n"
  368. " use '-device help' to print all possible drivers\n"
  369. " use '-device driver,help' to print all possible properties\n",
  370. QEMU_ARCH_ALL)
  371. STEXI
  372. @item -device @var{driver}[,@var{prop}[=@var{value}][,...]]
  373. @findex -device
  374. Add device @var{driver}. @var{prop}=@var{value} sets driver
  375. properties. Valid properties depend on the driver. To get help on
  376. possible drivers and properties, use @code{-device help} and
  377. @code{-device @var{driver},help}.
  378. Some drivers are:
  379. @item -device ipmi-bmc-sim,id=@var{id}[,slave_addr=@var{val}]
  380. Add an IPMI BMC. This is a simulation of a hardware management
  381. interface processor that normally sits on a system. It provides
  382. a watchdog and the ability to reset and power control the system.
  383. You need to connect this to an IPMI interface to make it useful
  384. The IPMI slave address to use for the BMC. The default is 0x20.
  385. This address is the BMC's address on the I2C network of management
  386. controllers. If you don't know what this means, it is safe to ignore
  387. it.
  388. @item -device ipmi-bmc-extern,id=@var{id},chardev=@var{id}[,slave_addr=@var{val}]
  389. Add a connection to an external IPMI BMC simulator. Instead of
  390. locally emulating the BMC like the above item, instead connect
  391. to an external entity that provides the IPMI services.
  392. A connection is made to an external BMC simulator. If you do this, it
  393. is strongly recommended that you use the "reconnect=" chardev option
  394. to reconnect to the simulator if the connection is lost. Note that if
  395. this is not used carefully, it can be a security issue, as the
  396. interface has the ability to send resets, NMIs, and power off the VM.
  397. It's best if QEMU makes a connection to an external simulator running
  398. on a secure port on localhost, so neither the simulator nor QEMU is
  399. exposed to any outside network.
  400. See the "lanserv/README.vm" file in the OpenIPMI library for more
  401. details on the external interface.
  402. @item -device isa-ipmi-kcs,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}]
  403. Add a KCS IPMI interafce on the ISA bus. This also adds a
  404. corresponding ACPI and SMBIOS entries, if appropriate.
  405. @table @option
  406. @item bmc=@var{id}
  407. The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern above.
  408. @item ioport=@var{val}
  409. Define the I/O address of the interface. The default is 0xca0 for KCS.
  410. @item irq=@var{val}
  411. Define the interrupt to use. The default is 5. To disable interrupts,
  412. set this to 0.
  413. @end table
  414. @item -device isa-ipmi-bt,bmc=@var{id}[,ioport=@var{val}][,irq=@var{val}]
  415. Like the KCS interface, but defines a BT interface. The default port is
  416. 0xe4 and the default interrupt is 5.
  417. ETEXI
  418. DEF("name", HAS_ARG, QEMU_OPTION_name,
  419. "-name string1[,process=string2][,debug-threads=on|off]\n"
  420. " set the name of the guest\n"
  421. " string1 sets the window title and string2 the process name (on Linux)\n"
  422. " When debug-threads is enabled, individual threads are given a separate name (on Linux)\n"
  423. " NOTE: The thread names are for debugging and not a stable API.\n",
  424. QEMU_ARCH_ALL)
  425. STEXI
  426. @item -name @var{name}
  427. @findex -name
  428. Sets the @var{name} of the guest.
  429. This name will be displayed in the SDL window caption.
  430. The @var{name} will also be used for the VNC server.
  431. Also optionally set the top visible process name in Linux.
  432. Naming of individual threads can also be enabled on Linux to aid debugging.
  433. ETEXI
  434. DEF("uuid", HAS_ARG, QEMU_OPTION_uuid,
  435. "-uuid %08x-%04x-%04x-%04x-%012x\n"
  436. " specify machine UUID\n", QEMU_ARCH_ALL)
  437. STEXI
  438. @item -uuid @var{uuid}
  439. @findex -uuid
  440. Set system UUID.
  441. ETEXI
  442. STEXI
  443. @end table
  444. ETEXI
  445. DEFHEADING()
  446. DEFHEADING(Block device options)
  447. STEXI
  448. @table @option
  449. ETEXI
  450. DEF("fda", HAS_ARG, QEMU_OPTION_fda,
  451. "-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
  452. DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
  453. STEXI
  454. @item -fda @var{file}
  455. @itemx -fdb @var{file}
  456. @findex -fda
  457. @findex -fdb
  458. Use @var{file} as floppy disk 0/1 image (@pxref{disk_images}).
  459. ETEXI
  460. DEF("hda", HAS_ARG, QEMU_OPTION_hda,
  461. "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n", QEMU_ARCH_ALL)
  462. DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL)
  463. DEF("hdc", HAS_ARG, QEMU_OPTION_hdc,
  464. "-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n", QEMU_ARCH_ALL)
  465. DEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL)
  466. STEXI
  467. @item -hda @var{file}
  468. @itemx -hdb @var{file}
  469. @itemx -hdc @var{file}
  470. @itemx -hdd @var{file}
  471. @findex -hda
  472. @findex -hdb
  473. @findex -hdc
  474. @findex -hdd
  475. Use @var{file} as hard disk 0, 1, 2 or 3 image (@pxref{disk_images}).
  476. ETEXI
  477. DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom,
  478. "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n",
  479. QEMU_ARCH_ALL)
  480. STEXI
  481. @item -cdrom @var{file}
  482. @findex -cdrom
  483. Use @var{file} as CD-ROM image (you cannot use @option{-hdc} and
  484. @option{-cdrom} at the same time). You can use the host CD-ROM by
  485. using @file{/dev/cdrom} as filename (@pxref{host_drives}).
  486. ETEXI
  487. DEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev,
  488. "-blockdev [driver=]driver[,node-name=N][,discard=ignore|unmap]\n"
  489. " [,cache.direct=on|off][,cache.no-flush=on|off]\n"
  490. " [,read-only=on|off][,detect-zeroes=on|off|unmap]\n"
  491. " [,driver specific parameters...]\n"
  492. " configure a block backend\n", QEMU_ARCH_ALL)
  493. DEF("drive", HAS_ARG, QEMU_OPTION_drive,
  494. "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n"
  495. " [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off]\n"
  496. " [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n"
  497. " [,serial=s][,addr=A][,rerror=ignore|stop|report]\n"
  498. " [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\n"
  499. " [,readonly=on|off][,copy-on-read=on|off]\n"
  500. " [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n"
  501. " [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n"
  502. " [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n"
  503. " [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n"
  504. " [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n"
  505. " [[,iops_size=is]]\n"
  506. " [[,group=g]]\n"
  507. " use 'file' as a drive image\n", QEMU_ARCH_ALL)
  508. STEXI
  509. @item -drive @var{option}[,@var{option}[,@var{option}[,...]]]
  510. @findex -drive
  511. Define a new drive. Valid options are:
  512. @table @option
  513. @item file=@var{file}
  514. This option defines which disk image (@pxref{disk_images}) to use with
  515. this drive. If the filename contains comma, you must double it
  516. (for instance, "file=my,,file" to use file "my,file").
  517. Special files such as iSCSI devices can be specified using protocol
  518. specific URLs. See the section for "Device URL Syntax" for more information.
  519. @item if=@var{interface}
  520. This option defines on which type on interface the drive is connected.
  521. Available types are: ide, scsi, sd, mtd, floppy, pflash, virtio.
  522. @item bus=@var{bus},unit=@var{unit}
  523. These options define where is connected the drive by defining the bus number and
  524. the unit id.
  525. @item index=@var{index}
  526. This option defines where is connected the drive by using an index in the list
  527. of available connectors of a given interface type.
  528. @item media=@var{media}
  529. This option defines the type of the media: disk or cdrom.
  530. @item cyls=@var{c},heads=@var{h},secs=@var{s}[,trans=@var{t}]
  531. These options have the same definition as they have in @option{-hdachs}.
  532. @item snapshot=@var{snapshot}
  533. @var{snapshot} is "on" or "off" and controls snapshot mode for the given drive
  534. (see @option{-snapshot}).
  535. @item cache=@var{cache}
  536. @var{cache} is "none", "writeback", "unsafe", "directsync" or "writethrough" and controls how the host cache is used to access block data.
  537. @item aio=@var{aio}
  538. @var{aio} is "threads", or "native" and selects between pthread based disk I/O and native Linux AIO.
  539. @item discard=@var{discard}
  540. @var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and controls whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap}) requests are ignored or passed to the filesystem. Some machine types may not support discard requests.
  541. @item format=@var{format}
  542. Specify which disk @var{format} will be used rather than detecting
  543. the format. Can be used to specify format=raw to avoid interpreting
  544. an untrusted format header.
  545. @item serial=@var{serial}
  546. This option specifies the serial number to assign to the device.
  547. @item addr=@var{addr}
  548. Specify the controller's PCI address (if=virtio only).
  549. @item werror=@var{action},rerror=@var{action}
  550. Specify which @var{action} to take on write and read errors. Valid actions are:
  551. "ignore" (ignore the error and try to continue), "stop" (pause QEMU),
  552. "report" (report the error to the guest), "enospc" (pause QEMU only if the
  553. host disk is full; report the error to the guest otherwise).
  554. The default setting is @option{werror=enospc} and @option{rerror=report}.
  555. @item readonly
  556. Open drive @option{file} as read-only. Guest write attempts will fail.
  557. @item copy-on-read=@var{copy-on-read}
  558. @var{copy-on-read} is "on" or "off" and enables whether to copy read backing
  559. file sectors into the image file.
  560. @item detect-zeroes=@var{detect-zeroes}
  561. @var{detect-zeroes} is "off", "on" or "unmap" and enables the automatic
  562. conversion of plain zero writes by the OS to driver specific optimized
  563. zero write commands. You may even choose "unmap" if @var{discard} is set
  564. to "unmap" to allow a zero write to be converted to an UNMAP operation.
  565. @end table
  566. By default, the @option{cache=writeback} mode is used. It will report data
  567. writes as completed as soon as the data is present in the host page cache.
  568. This is safe as long as your guest OS makes sure to correctly flush disk caches
  569. where needed. If your guest OS does not handle volatile disk write caches
  570. correctly and your host crashes or loses power, then the guest may experience
  571. data corruption.
  572. For such guests, you should consider using @option{cache=writethrough}. This
  573. means that the host page cache will be used to read and write data, but write
  574. notification will be sent to the guest only after QEMU has made sure to flush
  575. each write to the disk. Be aware that this has a major impact on performance.
  576. The host page cache can be avoided entirely with @option{cache=none}. This will
  577. attempt to do disk IO directly to the guest's memory. QEMU may still perform
  578. an internal copy of the data. Note that this is considered a writeback mode and
  579. the guest OS must handle the disk write cache correctly in order to avoid data
  580. corruption on host crashes.
  581. The host page cache can be avoided while only sending write notifications to
  582. the guest when the data has been flushed to the disk using
  583. @option{cache=directsync}.
  584. In case you don't care about data integrity over host failures, use
  585. @option{cache=unsafe}. This option tells QEMU that it never needs to write any
  586. data to the disk but can instead keep things in cache. If anything goes wrong,
  587. like your host losing power, the disk storage getting disconnected accidentally,
  588. etc. your image will most probably be rendered unusable. When using
  589. the @option{-snapshot} option, unsafe caching is always used.
  590. Copy-on-read avoids accessing the same backing file sectors repeatedly and is
  591. useful when the backing file is over a slow network. By default copy-on-read
  592. is off.
  593. Instead of @option{-cdrom} you can use:
  594. @example
  595. qemu-system-i386 -drive file=file,index=2,media=cdrom
  596. @end example
  597. Instead of @option{-hda}, @option{-hdb}, @option{-hdc}, @option{-hdd}, you can
  598. use:
  599. @example
  600. qemu-system-i386 -drive file=file,index=0,media=disk
  601. qemu-system-i386 -drive file=file,index=1,media=disk
  602. qemu-system-i386 -drive file=file,index=2,media=disk
  603. qemu-system-i386 -drive file=file,index=3,media=disk
  604. @end example
  605. You can open an image using pre-opened file descriptors from an fd set:
  606. @example
  607. qemu-system-i386
  608. -add-fd fd=3,set=2,opaque="rdwr:/path/to/file"
  609. -add-fd fd=4,set=2,opaque="rdonly:/path/to/file"
  610. -drive file=/dev/fdset/2,index=0,media=disk
  611. @end example
  612. You can connect a CDROM to the slave of ide0:
  613. @example
  614. qemu-system-i386 -drive file=file,if=ide,index=1,media=cdrom
  615. @end example
  616. If you don't specify the "file=" argument, you define an empty drive:
  617. @example
  618. qemu-system-i386 -drive if=ide,index=1,media=cdrom
  619. @end example
  620. Instead of @option{-fda}, @option{-fdb}, you can use:
  621. @example
  622. qemu-system-i386 -drive file=file,index=0,if=floppy
  623. qemu-system-i386 -drive file=file,index=1,if=floppy
  624. @end example
  625. By default, @var{interface} is "ide" and @var{index} is automatically
  626. incremented:
  627. @example
  628. qemu-system-i386 -drive file=a -drive file=b"
  629. @end example
  630. is interpreted like:
  631. @example
  632. qemu-system-i386 -hda a -hdb b
  633. @end example
  634. ETEXI
  635. DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock,
  636. "-mtdblock file use 'file' as on-board Flash memory image\n",
  637. QEMU_ARCH_ALL)
  638. STEXI
  639. @item -mtdblock @var{file}
  640. @findex -mtdblock
  641. Use @var{file} as on-board Flash memory image.
  642. ETEXI
  643. DEF("sd", HAS_ARG, QEMU_OPTION_sd,
  644. "-sd file use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL)
  645. STEXI
  646. @item -sd @var{file}
  647. @findex -sd
  648. Use @var{file} as SecureDigital card image.
  649. ETEXI
  650. DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
  651. "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
  652. STEXI
  653. @item -pflash @var{file}
  654. @findex -pflash
  655. Use @var{file} as a parallel flash image.
  656. ETEXI
  657. DEF("snapshot", 0, QEMU_OPTION_snapshot,
  658. "-snapshot write to temporary files instead of disk image files\n",
  659. QEMU_ARCH_ALL)
  660. STEXI
  661. @item -snapshot
  662. @findex -snapshot
  663. Write to temporary files instead of disk image files. In this case,
  664. the raw disk image you use is not written back. You can however force
  665. the write back by pressing @key{C-a s} (@pxref{disk_images}).
  666. ETEXI
  667. DEF("hdachs", HAS_ARG, QEMU_OPTION_hdachs, \
  668. "-hdachs c,h,s[,t]\n" \
  669. " force hard disk 0 physical geometry and the optional BIOS\n" \
  670. " translation (t=none or lba) (usually QEMU can guess them)\n",
  671. QEMU_ARCH_ALL)
  672. STEXI
  673. @item -hdachs @var{c},@var{h},@var{s},[,@var{t}]
  674. @findex -hdachs
  675. Force hard disk 0 physical geometry (1 <= @var{c} <= 16383, 1 <=
  676. @var{h} <= 16, 1 <= @var{s} <= 63) and optionally force the BIOS
  677. translation mode (@var{t}=none, lba or auto). Usually QEMU can guess
  678. all those parameters. This option is useful for old MS-DOS disk
  679. images.
  680. ETEXI
  681. DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,
  682. "-fsdev fsdriver,id=id[,path=path,][security_model={mapped-xattr|mapped-file|passthrough|none}]\n"
  683. " [,writeout=immediate][,readonly][,socket=socket|sock_fd=sock_fd]\n"
  684. " [[,throttling.bps-total=b]|[[,throttling.bps-read=r][,throttling.bps-write=w]]]\n"
  685. " [[,throttling.iops-total=i]|[[,throttling.iops-read=r][,throttling.iops-write=w]]]\n"
  686. " [[,throttling.bps-total-max=bm]|[[,throttling.bps-read-max=rm][,throttling.bps-write-max=wm]]]\n"
  687. " [[,throttling.iops-total-max=im]|[[,throttling.iops-read-max=irm][,throttling.iops-write-max=iwm]]]\n"
  688. " [[,throttling.iops-size=is]]\n",
  689. QEMU_ARCH_ALL)
  690. STEXI
  691. @item -fsdev @var{fsdriver},id=@var{id},path=@var{path},[security_model=@var{security_model}][,writeout=@var{writeout}][,readonly][,socket=@var{socket}|sock_fd=@var{sock_fd}]
  692. @findex -fsdev
  693. Define a new file system device. Valid options are:
  694. @table @option
  695. @item @var{fsdriver}
  696. This option specifies the fs driver backend to use.
  697. Currently "local", "handle" and "proxy" file system drivers are supported.
  698. @item id=@var{id}
  699. Specifies identifier for this device
  700. @item path=@var{path}
  701. Specifies the export path for the file system device. Files under
  702. this path will be available to the 9p client on the guest.
  703. @item security_model=@var{security_model}
  704. Specifies the security model to be used for this export path.
  705. Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
  706. In "passthrough" security model, files are stored using the same
  707. credentials as they are created on the guest. This requires QEMU
  708. to run as root. In "mapped-xattr" security model, some of the file
  709. attributes like uid, gid, mode bits and link target are stored as
  710. file attributes. For "mapped-file" these attributes are stored in the
  711. hidden .virtfs_metadata directory. Directories exported by this security model cannot
  712. interact with other unix tools. "none" security model is same as
  713. passthrough except the sever won't report failures if it fails to
  714. set file attributes like ownership. Security model is mandatory
  715. only for local fsdriver. Other fsdrivers (like handle, proxy) don't take
  716. security model as a parameter.
  717. @item writeout=@var{writeout}
  718. This is an optional argument. The only supported value is "immediate".
  719. This means that host page cache will be used to read and write data but
  720. write notification will be sent to the guest only when the data has been
  721. reported as written by the storage subsystem.
  722. @item readonly
  723. Enables exporting 9p share as a readonly mount for guests. By default
  724. read-write access is given.
  725. @item socket=@var{socket}
  726. Enables proxy filesystem driver to use passed socket file for communicating
  727. with virtfs-proxy-helper
  728. @item sock_fd=@var{sock_fd}
  729. Enables proxy filesystem driver to use passed socket descriptor for
  730. communicating with virtfs-proxy-helper. Usually a helper like libvirt
  731. will create socketpair and pass one of the fds as sock_fd
  732. @end table
  733. -fsdev option is used along with -device driver "virtio-9p-pci".
  734. @item -device virtio-9p-pci,fsdev=@var{id},mount_tag=@var{mount_tag}
  735. Options for virtio-9p-pci driver are:
  736. @table @option
  737. @item fsdev=@var{id}
  738. Specifies the id value specified along with -fsdev option
  739. @item mount_tag=@var{mount_tag}
  740. Specifies the tag name to be used by the guest to mount this export point
  741. @end table
  742. ETEXI
  743. DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs,
  744. "-virtfs local,path=path,mount_tag=tag,security_model=[mapped-xattr|mapped-file|passthrough|none]\n"
  745. " [,writeout=immediate][,readonly][,socket=socket|sock_fd=sock_fd]\n",
  746. QEMU_ARCH_ALL)
  747. STEXI
  748. @item -virtfs @var{fsdriver}[,path=@var{path}],mount_tag=@var{mount_tag}[,security_model=@var{security_model}][,writeout=@var{writeout}][,readonly][,socket=@var{socket}|sock_fd=@var{sock_fd}]
  749. @findex -virtfs
  750. The general form of a Virtual File system pass-through options are:
  751. @table @option
  752. @item @var{fsdriver}
  753. This option specifies the fs driver backend to use.
  754. Currently "local", "handle" and "proxy" file system drivers are supported.
  755. @item id=@var{id}
  756. Specifies identifier for this device
  757. @item path=@var{path}
  758. Specifies the export path for the file system device. Files under
  759. this path will be available to the 9p client on the guest.
  760. @item security_model=@var{security_model}
  761. Specifies the security model to be used for this export path.
  762. Supported security models are "passthrough", "mapped-xattr", "mapped-file" and "none".
  763. In "passthrough" security model, files are stored using the same
  764. credentials as they are created on the guest. This requires QEMU
  765. to run as root. In "mapped-xattr" security model, some of the file
  766. attributes like uid, gid, mode bits and link target are stored as
  767. file attributes. For "mapped-file" these attributes are stored in the
  768. hidden .virtfs_metadata directory. Directories exported by this security model cannot
  769. interact with other unix tools. "none" security model is same as
  770. passthrough except the sever won't report failures if it fails to
  771. set file attributes like ownership. Security model is mandatory only
  772. for local fsdriver. Other fsdrivers (like handle, proxy) don't take security
  773. model as a parameter.
  774. @item writeout=@var{writeout}
  775. This is an optional argument. The only supported value is "immediate".
  776. This means that host page cache will be used to read and write data but
  777. write notification will be sent to the guest only when the data has been
  778. reported as written by the storage subsystem.
  779. @item readonly
  780. Enables exporting 9p share as a readonly mount for guests. By default
  781. read-write access is given.
  782. @item socket=@var{socket}
  783. Enables proxy filesystem driver to use passed socket file for
  784. communicating with virtfs-proxy-helper. Usually a helper like libvirt
  785. will create socketpair and pass one of the fds as sock_fd
  786. @item sock_fd
  787. Enables proxy filesystem driver to use passed 'sock_fd' as the socket
  788. descriptor for interfacing with virtfs-proxy-helper
  789. @end table
  790. ETEXI
  791. DEF("virtfs_synth", 0, QEMU_OPTION_virtfs_synth,
  792. "-virtfs_synth Create synthetic file system image\n",
  793. QEMU_ARCH_ALL)
  794. STEXI
  795. @item -virtfs_synth
  796. @findex -virtfs_synth
  797. Create synthetic file system image
  798. ETEXI
  799. STEXI
  800. @end table
  801. ETEXI
  802. DEFHEADING()
  803. DEFHEADING(USB options)
  804. STEXI
  805. @table @option
  806. ETEXI
  807. DEF("usb", 0, QEMU_OPTION_usb,
  808. "-usb enable the USB driver (will be the default soon)\n",
  809. QEMU_ARCH_ALL)
  810. STEXI
  811. @item -usb
  812. @findex -usb
  813. Enable the USB driver (will be the default soon)
  814. ETEXI
  815. DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice,
  816. "-usbdevice name add the host or guest USB device 'name'\n",
  817. QEMU_ARCH_ALL)
  818. STEXI
  819. @item -usbdevice @var{devname}
  820. @findex -usbdevice
  821. Add the USB device @var{devname}. @xref{usb_devices}.
  822. @table @option
  823. @item mouse
  824. Virtual Mouse. This will override the PS/2 mouse emulation when activated.
  825. @item tablet
  826. Pointer device that uses absolute coordinates (like a touchscreen). This
  827. means QEMU is able to report the mouse position without having to grab the
  828. mouse. Also overrides the PS/2 mouse emulation when activated.
  829. @item disk:[format=@var{format}]:@var{file}
  830. Mass storage device based on file. The optional @var{format} argument
  831. will be used rather than detecting the format. Can be used to specify
  832. @code{format=raw} to avoid interpreting an untrusted format header.
  833. @item host:@var{bus}.@var{addr}
  834. Pass through the host device identified by @var{bus}.@var{addr} (Linux only).
  835. @item host:@var{vendor_id}:@var{product_id}
  836. Pass through the host device identified by @var{vendor_id}:@var{product_id}
  837. (Linux only).
  838. @item serial:[vendorid=@var{vendor_id}][,productid=@var{product_id}]:@var{dev}
  839. Serial converter to host character device @var{dev}, see @code{-serial} for the
  840. available devices.
  841. @item braille
  842. Braille device. This will use BrlAPI to display the braille output on a real
  843. or fake device.
  844. @item net:@var{options}
  845. Network adapter that supports CDC ethernet and RNDIS protocols.
  846. @end table
  847. ETEXI
  848. STEXI
  849. @end table
  850. ETEXI
  851. DEFHEADING()
  852. DEFHEADING(Display options)
  853. STEXI
  854. @table @option
  855. ETEXI
  856. DEF("display", HAS_ARG, QEMU_OPTION_display,
  857. "-display sdl[,frame=on|off][,alt_grab=on|off][,ctrl_grab=on|off]\n"
  858. " [,window_close=on|off][,gl=on|off]\n"
  859. "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n"
  860. "-display vnc=<display>[,<optargs>]\n"
  861. "-display curses\n"
  862. "-display none"
  863. " select display type\n"
  864. "The default display is equivalent to\n"
  865. #if defined(CONFIG_GTK)
  866. "\t\"-display gtk\"\n"
  867. #elif defined(CONFIG_SDL)
  868. "\t\"-display sdl\"\n"
  869. #elif defined(CONFIG_COCOA)
  870. "\t\"-display cocoa\"\n"
  871. #elif defined(CONFIG_VNC)
  872. "\t\"-vnc localhost:0,to=99,id=default\"\n"
  873. #else
  874. "\t\"-display none\"\n"
  875. #endif
  876. , QEMU_ARCH_ALL)
  877. STEXI
  878. @item -display @var{type}
  879. @findex -display
  880. Select type of display to use. This option is a replacement for the
  881. old style -sdl/-curses/... options. Valid values for @var{type} are
  882. @table @option
  883. @item sdl
  884. Display video output via SDL (usually in a separate graphics
  885. window; see the SDL documentation for other possibilities).
  886. @item curses
  887. Display video output via curses. For graphics device models which
  888. support a text mode, QEMU can display this output using a
  889. curses/ncurses interface. Nothing is displayed when the graphics
  890. device is in graphical mode or if the graphics device does not support
  891. a text mode. Generally only the VGA device models support text mode.
  892. @item none
  893. Do not display video output. The guest will still see an emulated
  894. graphics card, but its output will not be displayed to the QEMU
  895. user. This option differs from the -nographic option in that it
  896. only affects what is done with video output; -nographic also changes
  897. the destination of the serial and parallel port data.
  898. @item gtk
  899. Display video output in a GTK window. This interface provides drop-down
  900. menus and other UI elements to configure and control the VM during
  901. runtime.
  902. @item vnc
  903. Start a VNC server on display <arg>
  904. @end table
  905. ETEXI
  906. DEF("nographic", 0, QEMU_OPTION_nographic,
  907. "-nographic disable graphical output and redirect serial I/Os to console\n",
  908. QEMU_ARCH_ALL)
  909. STEXI
  910. @item -nographic
  911. @findex -nographic
  912. Normally, if QEMU is compiled with graphical window support, it displays
  913. output such as guest graphics, guest console, and the QEMU monitor in a
  914. window. With this option, you can totally disable graphical output so
  915. that QEMU is a simple command line application. The emulated serial port
  916. is redirected on the console and muxed with the monitor (unless
  917. redirected elsewhere explicitly). Therefore, you can still use QEMU to
  918. debug a Linux kernel with a serial console. Use @key{C-a h} for help on
  919. switching between the console and monitor.
  920. ETEXI
  921. DEF("curses", 0, QEMU_OPTION_curses,
  922. "-curses shorthand for -display curses\n",
  923. QEMU_ARCH_ALL)
  924. STEXI
  925. @item -curses
  926. @findex -curses
  927. Normally, if QEMU is compiled with graphical window support, it displays
  928. output such as guest graphics, guest console, and the QEMU monitor in a
  929. window. With this option, QEMU can display the VGA output when in text
  930. mode using a curses/ncurses interface. Nothing is displayed in graphical
  931. mode.
  932. ETEXI
  933. DEF("no-frame", 0, QEMU_OPTION_no_frame,
  934. "-no-frame open SDL window without a frame and window decorations\n",
  935. QEMU_ARCH_ALL)
  936. STEXI
  937. @item -no-frame
  938. @findex -no-frame
  939. Do not use decorations for SDL windows and start them using the whole
  940. available screen space. This makes the using QEMU in a dedicated desktop
  941. workspace more convenient.
  942. ETEXI
  943. DEF("alt-grab", 0, QEMU_OPTION_alt_grab,
  944. "-alt-grab use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n",
  945. QEMU_ARCH_ALL)
  946. STEXI
  947. @item -alt-grab
  948. @findex -alt-grab
  949. Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that this also
  950. affects the special keys (for fullscreen, monitor-mode switching, etc).
  951. ETEXI
  952. DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
  953. "-ctrl-grab use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n",
  954. QEMU_ARCH_ALL)
  955. STEXI
  956. @item -ctrl-grab
  957. @findex -ctrl-grab
  958. Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this also
  959. affects the special keys (for fullscreen, monitor-mode switching, etc).
  960. ETEXI
  961. DEF("no-quit", 0, QEMU_OPTION_no_quit,
  962. "-no-quit disable SDL window close capability\n", QEMU_ARCH_ALL)
  963. STEXI
  964. @item -no-quit
  965. @findex -no-quit
  966. Disable SDL window close capability.
  967. ETEXI
  968. DEF("sdl", 0, QEMU_OPTION_sdl,
  969. "-sdl shorthand for -display sdl\n", QEMU_ARCH_ALL)
  970. STEXI
  971. @item -sdl
  972. @findex -sdl
  973. Enable SDL.
  974. ETEXI
  975. DEF("spice", HAS_ARG, QEMU_OPTION_spice,
  976. "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
  977. " [,x509-key-file=<file>][,x509-key-password=<file>]\n"
  978. " [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n"
  979. " [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6|unix]\n"
  980. " [,tls-ciphers=<list>]\n"
  981. " [,tls-channel=[main|display|cursor|inputs|record|playback]]\n"
  982. " [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n"
  983. " [,sasl][,password=<secret>][,disable-ticketing]\n"
  984. " [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n"
  985. " [,jpeg-wan-compression=[auto|never|always]]\n"
  986. " [,zlib-glz-wan-compression=[auto|never|always]]\n"
  987. " [,streaming-video=[off|all|filter]][,disable-copy-paste]\n"
  988. " [,disable-agent-file-xfer][,agent-mouse=[on|off]]\n"
  989. " [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n"
  990. " [,gl=[on|off]][,rendernode=<file>]\n"
  991. " enable spice\n"
  992. " at least one of {port, tls-port} is mandatory\n",
  993. QEMU_ARCH_ALL)
  994. STEXI
  995. @item -spice @var{option}[,@var{option}[,...]]
  996. @findex -spice
  997. Enable the spice remote desktop protocol. Valid options are
  998. @table @option
  999. @item port=<nr>
  1000. Set the TCP port spice is listening on for plaintext channels.
  1001. @item addr=<addr>
  1002. Set the IP address spice is listening on. Default is any address.
  1003. @item ipv4
  1004. @itemx ipv6
  1005. @itemx unix
  1006. Force using the specified IP version.
  1007. @item password=<secret>
  1008. Set the password you need to authenticate.
  1009. @item sasl
  1010. Require that the client use SASL to authenticate with the spice.
  1011. The exact choice of authentication method used is controlled from the
  1012. system / user's SASL configuration file for the 'qemu' service. This
  1013. is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
  1014. unprivileged user, an environment variable SASL_CONF_PATH can be used
  1015. to make it search alternate locations for the service config.
  1016. While some SASL auth methods can also provide data encryption (eg GSSAPI),
  1017. it is recommended that SASL always be combined with the 'tls' and
  1018. 'x509' settings to enable use of SSL and server certificates. This
  1019. ensures a data encryption preventing compromise of authentication
  1020. credentials.
  1021. @item disable-ticketing
  1022. Allow client connects without authentication.
  1023. @item disable-copy-paste
  1024. Disable copy paste between the client and the guest.
  1025. @item disable-agent-file-xfer
  1026. Disable spice-vdagent based file-xfer between the client and the guest.
  1027. @item tls-port=<nr>
  1028. Set the TCP port spice is listening on for encrypted channels.
  1029. @item x509-dir=<dir>
  1030. Set the x509 file directory. Expects same filenames as -vnc $display,x509=$dir
  1031. @item x509-key-file=<file>
  1032. @itemx x509-key-password=<file>
  1033. @itemx x509-cert-file=<file>
  1034. @itemx x509-cacert-file=<file>
  1035. @itemx x509-dh-key-file=<file>
  1036. The x509 file names can also be configured individually.
  1037. @item tls-ciphers=<list>
  1038. Specify which ciphers to use.
  1039. @item tls-channel=[main|display|cursor|inputs|record|playback]
  1040. @itemx plaintext-channel=[main|display|cursor|inputs|record|playback]
  1041. Force specific channel to be used with or without TLS encryption. The
  1042. options can be specified multiple times to configure multiple
  1043. channels. The special name "default" can be used to set the default
  1044. mode. For channels which are not explicitly forced into one mode the
  1045. spice client is allowed to pick tls/plaintext as he pleases.
  1046. @item image-compression=[auto_glz|auto_lz|quic|glz|lz|off]
  1047. Configure image compression (lossless).
  1048. Default is auto_glz.
  1049. @item jpeg-wan-compression=[auto|never|always]
  1050. @itemx zlib-glz-wan-compression=[auto|never|always]
  1051. Configure wan image compression (lossy for slow links).
  1052. Default is auto.
  1053. @item streaming-video=[off|all|filter]
  1054. Configure video stream detection. Default is off.
  1055. @item agent-mouse=[on|off]
  1056. Enable/disable passing mouse events via vdagent. Default is on.
  1057. @item playback-compression=[on|off]
  1058. Enable/disable audio stream compression (using celt 0.5.1). Default is on.
  1059. @item seamless-migration=[on|off]
  1060. Enable/disable spice seamless migration. Default is off.
  1061. @item gl=[on|off]
  1062. Enable/disable OpenGL context. Default is off.
  1063. @item rendernode=<file>
  1064. DRM render node for OpenGL rendering. If not specified, it will pick
  1065. the first available. (Since 2.9)
  1066. @end table
  1067. ETEXI
  1068. DEF("portrait", 0, QEMU_OPTION_portrait,
  1069. "-portrait rotate graphical output 90 deg left (only PXA LCD)\n",
  1070. QEMU_ARCH_ALL)
  1071. STEXI
  1072. @item -portrait
  1073. @findex -portrait
  1074. Rotate graphical output 90 deg left (only PXA LCD).
  1075. ETEXI
  1076. DEF("rotate", HAS_ARG, QEMU_OPTION_rotate,
  1077. "-rotate <deg> rotate graphical output some deg left (only PXA LCD)\n",
  1078. QEMU_ARCH_ALL)
  1079. STEXI
  1080. @item -rotate @var{deg}
  1081. @findex -rotate
  1082. Rotate graphical output some deg left (only PXA LCD).
  1083. ETEXI
  1084. DEF("vga", HAS_ARG, QEMU_OPTION_vga,
  1085. "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n"
  1086. " select video card type\n", QEMU_ARCH_ALL)
  1087. STEXI
  1088. @item -vga @var{type}
  1089. @findex -vga
  1090. Select type of VGA card to emulate. Valid values for @var{type} are
  1091. @table @option
  1092. @item cirrus
  1093. Cirrus Logic GD5446 Video card. All Windows versions starting from
  1094. Windows 95 should recognize and use this graphic card. For optimal
  1095. performances, use 16 bit color depth in the guest and the host OS.
  1096. (This card was the default before QEMU 2.2)
  1097. @item std
  1098. Standard VGA card with Bochs VBE extensions. If your guest OS
  1099. supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if you want
  1100. to use high resolution modes (>= 1280x1024x16) then you should use
  1101. this option. (This card is the default since QEMU 2.2)
  1102. @item vmware
  1103. VMWare SVGA-II compatible adapter. Use it if you have sufficiently
  1104. recent XFree86/XOrg server or Windows guest with a driver for this
  1105. card.
  1106. @item qxl
  1107. QXL paravirtual graphic card. It is VGA compatible (including VESA
  1108. 2.0 VBE support). Works best with qxl guest drivers installed though.
  1109. Recommended choice when using the spice protocol.
  1110. @item tcx
  1111. (sun4m only) Sun TCX framebuffer. This is the default framebuffer for
  1112. sun4m machines and offers both 8-bit and 24-bit colour depths at a
  1113. fixed resolution of 1024x768.
  1114. @item cg3
  1115. (sun4m only) Sun cgthree framebuffer. This is a simple 8-bit framebuffer
  1116. for sun4m machines available in both 1024x768 (OpenBIOS) and 1152x900 (OBP)
  1117. resolutions aimed at people wishing to run older Solaris versions.
  1118. @item virtio
  1119. Virtio VGA card.
  1120. @item none
  1121. Disable VGA card.
  1122. @end table
  1123. ETEXI
  1124. DEF("full-screen", 0, QEMU_OPTION_full_screen,
  1125. "-full-screen start in full screen\n", QEMU_ARCH_ALL)
  1126. STEXI
  1127. @item -full-screen
  1128. @findex -full-screen
  1129. Start in full screen.
  1130. ETEXI
  1131. DEF("g", 1, QEMU_OPTION_g ,
  1132. "-g WxH[xDEPTH] Set the initial graphical resolution and depth\n",
  1133. QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
  1134. STEXI
  1135. @item -g @var{width}x@var{height}[x@var{depth}]
  1136. @findex -g
  1137. Set the initial graphical resolution and depth (PPC, SPARC only).
  1138. ETEXI
  1139. DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
  1140. "-vnc <display> shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL)
  1141. STEXI
  1142. @item -vnc @var{display}[,@var{option}[,@var{option}[,...]]]
  1143. @findex -vnc
  1144. Normally, if QEMU is compiled with graphical window support, it displays
  1145. output such as guest graphics, guest console, and the QEMU monitor in a
  1146. window. With this option, you can have QEMU listen on VNC display
  1147. @var{display} and redirect the VGA display over the VNC session. It is
  1148. very useful to enable the usb tablet device when using this option
  1149. (option @option{-usbdevice tablet}). When using the VNC display, you
  1150. must use the @option{-k} parameter to set the keyboard layout if you are
  1151. not using en-us. Valid syntax for the @var{display} is
  1152. @table @option
  1153. @item to=@var{L}
  1154. With this option, QEMU will try next available VNC @var{display}s, until the
  1155. number @var{L}, if the origianlly defined "-vnc @var{display}" is not
  1156. available, e.g. port 5900+@var{display} is already used by another
  1157. application. By default, to=0.
  1158. @item @var{host}:@var{d}
  1159. TCP connections will only be allowed from @var{host} on display @var{d}.
  1160. By convention the TCP port is 5900+@var{d}. Optionally, @var{host} can
  1161. be omitted in which case the server will accept connections from any host.
  1162. @item unix:@var{path}
  1163. Connections will be allowed over UNIX domain sockets where @var{path} is the
  1164. location of a unix socket to listen for connections on.
  1165. @item none
  1166. VNC is initialized but not started. The monitor @code{change} command
  1167. can be used to later start the VNC server.
  1168. @end table
  1169. Following the @var{display} value there may be one or more @var{option} flags
  1170. separated by commas. Valid options are
  1171. @table @option
  1172. @item reverse
  1173. Connect to a listening VNC client via a ``reverse'' connection. The
  1174. client is specified by the @var{display}. For reverse network
  1175. connections (@var{host}:@var{d},@code{reverse}), the @var{d} argument
  1176. is a TCP port number, not a display number.
  1177. @item websocket
  1178. Opens an additional TCP listening port dedicated to VNC Websocket connections.
  1179. If a bare @var{websocket} option is given, the Websocket port is
  1180. 5700+@var{display}. An alternative port can be specified with the
  1181. syntax @code{websocket}=@var{port}.
  1182. If @var{host} is specified connections will only be allowed from this host.
  1183. It is possible to control the websocket listen address independently, using
  1184. the syntax @code{websocket}=@var{host}:@var{port}.
  1185. If no TLS credentials are provided, the websocket connection runs in
  1186. unencrypted mode. If TLS credentials are provided, the websocket connection
  1187. requires encrypted client connections.
  1188. @item password
  1189. Require that password based authentication is used for client connections.
  1190. The password must be set separately using the @code{set_password} command in
  1191. the @ref{pcsys_monitor}. The syntax to change your password is:
  1192. @code{set_password <protocol> <password>} where <protocol> could be either
  1193. "vnc" or "spice".
  1194. If you would like to change <protocol> password expiration, you should use
  1195. @code{expire_password <protocol> <expiration-time>} where expiration time could
  1196. be one of the following options: now, never, +seconds or UNIX time of
  1197. expiration, e.g. +60 to make password expire in 60 seconds, or 1335196800
  1198. to make password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for this
  1199. date and time).
  1200. You can also use keywords "now" or "never" for the expiration time to
  1201. allow <protocol> password to expire immediately or never expire.
  1202. @item tls-creds=@var{ID}
  1203. Provides the ID of a set of TLS credentials to use to secure the
  1204. VNC server. They will apply to both the normal VNC server socket
  1205. and the websocket socket (if enabled). Setting TLS credentials
  1206. will cause the VNC server socket to enable the VeNCrypt auth
  1207. mechanism. The credentials should have been previously created
  1208. using the @option{-object tls-creds} argument.
  1209. The @option{tls-creds} parameter obsoletes the @option{tls},
  1210. @option{x509}, and @option{x509verify} options, and as such
  1211. it is not permitted to set both new and old type options at
  1212. the same time.
  1213. @item tls
  1214. Require that client use TLS when communicating with the VNC server. This
  1215. uses anonymous TLS credentials so is susceptible to a man-in-the-middle
  1216. attack. It is recommended that this option be combined with either the
  1217. @option{x509} or @option{x509verify} options.
  1218. This option is now deprecated in favor of using the @option{tls-creds}
  1219. argument.
  1220. @item x509=@var{/path/to/certificate/dir}
  1221. Valid if @option{tls} is specified. Require that x509 credentials are used
  1222. for negotiating the TLS session. The server will send its x509 certificate
  1223. to the client. It is recommended that a password be set on the VNC server
  1224. to provide authentication of the client when this is used. The path following
  1225. this option specifies where the x509 certificates are to be loaded from.
  1226. See the @ref{vnc_security} section for details on generating certificates.
  1227. This option is now deprecated in favour of using the @option{tls-creds}
  1228. argument.
  1229. @item x509verify=@var{/path/to/certificate/dir}
  1230. Valid if @option{tls} is specified. Require that x509 credentials are used
  1231. for negotiating the TLS session. The server will send its x509 certificate
  1232. to the client, and request that the client send its own x509 certificate.
  1233. The server will validate the client's certificate against the CA certificate,
  1234. and reject clients when validation fails. If the certificate authority is
  1235. trusted, this is a sufficient authentication mechanism. You may still wish
  1236. to set a password on the VNC server as a second authentication layer. The
  1237. path following this option specifies where the x509 certificates are to
  1238. be loaded from. See the @ref{vnc_security} section for details on generating
  1239. certificates.
  1240. This option is now deprecated in favour of using the @option{tls-creds}
  1241. argument.
  1242. @item sasl
  1243. Require that the client use SASL to authenticate with the VNC server.
  1244. The exact choice of authentication method used is controlled from the
  1245. system / user's SASL configuration file for the 'qemu' service. This
  1246. is typically found in /etc/sasl2/qemu.conf. If running QEMU as an
  1247. unprivileged user, an environment variable SASL_CONF_PATH can be used
  1248. to make it search alternate locations for the service config.
  1249. While some SASL auth methods can also provide data encryption (eg GSSAPI),
  1250. it is recommended that SASL always be combined with the 'tls' and
  1251. 'x509' settings to enable use of SSL and server certificates. This
  1252. ensures a data encryption preventing compromise of authentication
  1253. credentials. See the @ref{vnc_security} section for details on using
  1254. SASL authentication.
  1255. @item acl
  1256. Turn on access control lists for checking of the x509 client certificate
  1257. and SASL party. For x509 certs, the ACL check is made against the
  1258. certificate's distinguished name. This is something that looks like
  1259. @code{C=GB,O=ACME,L=Boston,CN=bob}. For SASL party, the ACL check is
  1260. made against the username, which depending on the SASL plugin, may
  1261. include a realm component, eg @code{bob} or @code{bob@@EXAMPLE.COM}.
  1262. When the @option{acl} flag is set, the initial access list will be
  1263. empty, with a @code{deny} policy. Thus no one will be allowed to
  1264. use the VNC server until the ACLs have been loaded. This can be
  1265. achieved using the @code{acl} monitor command.
  1266. @item lossy
  1267. Enable lossy compression methods (gradient, JPEG, ...). If this
  1268. option is set, VNC client may receive lossy framebuffer updates
  1269. depending on its encoding settings. Enabling this option can save
  1270. a lot of bandwidth at the expense of quality.
  1271. @item non-adaptive
  1272. Disable adaptive encodings. Adaptive encodings are enabled by default.
  1273. An adaptive encoding will try to detect frequently updated screen regions,
  1274. and send updates in these regions using a lossy encoding (like JPEG).
  1275. This can be really helpful to save bandwidth when playing videos. Disabling
  1276. adaptive encodings restores the original static behavior of encodings
  1277. like Tight.
  1278. @item share=[allow-exclusive|force-shared|ignore]
  1279. Set display sharing policy. 'allow-exclusive' allows clients to ask
  1280. for exclusive access. As suggested by the rfb spec this is
  1281. implemented by dropping other connections. Connecting multiple
  1282. clients in parallel requires all clients asking for a shared session
  1283. (vncviewer: -shared switch). This is the default. 'force-shared'
  1284. disables exclusive client access. Useful for shared desktop sessions,
  1285. where you don't want someone forgetting specify -shared disconnect
  1286. everybody else. 'ignore' completely ignores the shared flag and
  1287. allows everybody connect unconditionally. Doesn't conform to the rfb
  1288. spec but is traditional QEMU behavior.
  1289. @item key-delay-ms
  1290. Set keyboard delay, for key down and key up events, in milliseconds.
  1291. Default is 10. Keyboards are low-bandwidth devices, so this slowdown
  1292. can help the device and guest to keep up and not lose events in case
  1293. events are arriving in bulk. Possible causes for the latter are flaky
  1294. network connections, or scripts for automated testing.
  1295. @end table
  1296. ETEXI
  1297. STEXI
  1298. @end table
  1299. ETEXI
  1300. ARCHHEADING(, QEMU_ARCH_I386)
  1301. ARCHHEADING(i386 target only, QEMU_ARCH_I386)
  1302. STEXI
  1303. @table @option
  1304. ETEXI
  1305. DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack,
  1306. "-win2k-hack use it when installing Windows 2000 to avoid a disk full bug\n",
  1307. QEMU_ARCH_I386)
  1308. STEXI
  1309. @item -win2k-hack
  1310. @findex -win2k-hack
  1311. Use it when installing Windows 2000 to avoid a disk full bug. After
  1312. Windows 2000 is installed, you no longer need this option (this option
  1313. slows down the IDE transfers).
  1314. ETEXI
  1315. HXCOMM Deprecated by -rtc
  1316. DEF("rtc-td-hack", 0, QEMU_OPTION_rtc_td_hack, "", QEMU_ARCH_I386)
  1317. DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk,
  1318. "-no-fd-bootchk disable boot signature checking for floppy disks\n",
  1319. QEMU_ARCH_I386)
  1320. STEXI
  1321. @item -no-fd-bootchk
  1322. @findex -no-fd-bootchk
  1323. Disable boot signature checking for floppy disks in BIOS. May
  1324. be needed to boot from old floppy disks.
  1325. ETEXI
  1326. DEF("no-acpi", 0, QEMU_OPTION_no_acpi,
  1327. "-no-acpi disable ACPI\n", QEMU_ARCH_I386 | QEMU_ARCH_ARM)
  1328. STEXI
  1329. @item -no-acpi
  1330. @findex -no-acpi
  1331. Disable ACPI (Advanced Configuration and Power Interface) support. Use
  1332. it if your guest OS complains about ACPI problems (PC target machine
  1333. only).
  1334. ETEXI
  1335. DEF("no-hpet", 0, QEMU_OPTION_no_hpet,
  1336. "-no-hpet disable HPET\n", QEMU_ARCH_I386)
  1337. STEXI
  1338. @item -no-hpet
  1339. @findex -no-hpet
  1340. Disable HPET support.
  1341. ETEXI
  1342. DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable,
  1343. "-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n][,asl_compiler_id=str][,asl_compiler_rev=n][,{data|file}=file1[:file2]...]\n"
  1344. " ACPI table description\n", QEMU_ARCH_I386)
  1345. STEXI
  1346. @item -acpitable [sig=@var{str}][,rev=@var{n}][,oem_id=@var{str}][,oem_table_id=@var{str}][,oem_rev=@var{n}] [,asl_compiler_id=@var{str}][,asl_compiler_rev=@var{n}][,data=@var{file1}[:@var{file2}]...]
  1347. @findex -acpitable
  1348. Add ACPI table with specified header fields and context from specified files.
  1349. For file=, take whole ACPI table from the specified files, including all
  1350. ACPI headers (possible overridden by other options).
  1351. For data=, only data
  1352. portion of the table is used, all header information is specified in the
  1353. command line.
  1354. If a SLIC table is supplied to QEMU, then the SLIC's oem_id and oem_table_id
  1355. fields will override the same in the RSDT and the FADT (a.k.a. FACP), in order
  1356. to ensure the field matches required by the Microsoft SLIC spec and the ACPI
  1357. spec.
  1358. ETEXI
  1359. DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
  1360. "-smbios file=binary\n"
  1361. " load SMBIOS entry from binary file\n"
  1362. "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]\n"
  1363. " [,uefi=on|off]\n"
  1364. " specify SMBIOS type 0 fields\n"
  1365. "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
  1366. " [,uuid=uuid][,sku=str][,family=str]\n"
  1367. " specify SMBIOS type 1 fields\n"
  1368. "-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
  1369. " [,asset=str][,location=str]\n"
  1370. " specify SMBIOS type 2 fields\n"
  1371. "-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str]\n"
  1372. " [,sku=str]\n"
  1373. " specify SMBIOS type 3 fields\n"
  1374. "-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str]\n"
  1375. " [,asset=str][,part=str]\n"
  1376. " specify SMBIOS type 4 fields\n"
  1377. "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n"
  1378. " [,asset=str][,part=str][,speed=%d]\n"
  1379. " specify SMBIOS type 17 fields\n",
  1380. QEMU_ARCH_I386 | QEMU_ARCH_ARM)
  1381. STEXI
  1382. @item -smbios file=@var{binary}
  1383. @findex -smbios
  1384. Load SMBIOS entry from binary file.
  1385. @item -smbios type=0[,vendor=@var{str}][,version=@var{str}][,date=@var{str}][,release=@var{%d.%d}][,uefi=on|off]
  1386. Specify SMBIOS type 0 fields
  1387. @item -smbios type=1[,manufacturer=@var{str}][,product=@var{str}][,version=@var{str}][,serial=@var{str}][,uuid=@var{uuid}][,sku=@var{str}][,family=@var{str}]
  1388. Specify SMBIOS type 1 fields
  1389. @item -smbios type=2[,manufacturer=@var{str}][,product=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,location=@var{str}][,family=@var{str}]
  1390. Specify SMBIOS type 2 fields
  1391. @item -smbios type=3[,manufacturer=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,sku=@var{str}]
  1392. Specify SMBIOS type 3 fields
  1393. @item -smbios type=4[,sock_pfx=@var{str}][,manufacturer=@var{str}][,version=@var{str}][,serial=@var{str}][,asset=@var{str}][,part=@var{str}]
  1394. Specify SMBIOS type 4 fields
  1395. @item -smbios type=17[,loc_pfx=@var{str}][,bank=@var{str}][,manufacturer=@var{str}][,serial=@var{str}][,asset=@var{str}][,part=@var{str}][,speed=@var{%d}]
  1396. Specify SMBIOS type 17 fields
  1397. ETEXI
  1398. STEXI
  1399. @end table
  1400. ETEXI
  1401. DEFHEADING()
  1402. DEFHEADING(Network options)
  1403. STEXI
  1404. @table @option
  1405. ETEXI
  1406. HXCOMM Legacy slirp options (now moved to -net user):
  1407. #ifdef CONFIG_SLIRP
  1408. DEF("tftp", HAS_ARG, QEMU_OPTION_tftp, "", QEMU_ARCH_ALL)
  1409. DEF("bootp", HAS_ARG, QEMU_OPTION_bootp, "", QEMU_ARCH_ALL)
  1410. DEF("redir", HAS_ARG, QEMU_OPTION_redir, "", QEMU_ARCH_ALL)
  1411. #ifndef _WIN32
  1412. DEF("smb", HAS_ARG, QEMU_OPTION_smb, "", QEMU_ARCH_ALL)
  1413. #endif
  1414. #endif
  1415. DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
  1416. #ifdef CONFIG_SLIRP
  1417. "-netdev user,id=str[,ipv4[=on|off]][,net=addr[/mask]][,host=addr]\n"
  1418. " [,ipv6[=on|off]][,ipv6-net=addr[/int]][,ipv6-host=addr]\n"
  1419. " [,restrict=on|off][,hostname=host][,dhcpstart=addr]\n"
  1420. " [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,tftp=dir]\n"
  1421. " [,bootfile=f][,hostfwd=rule][,guestfwd=rule]"
  1422. #ifndef _WIN32
  1423. "[,smb=dir[,smbserver=addr]]\n"
  1424. #endif
  1425. " configure a user mode network backend with ID 'str',\n"
  1426. " its DHCP server and optional services\n"
  1427. #endif
  1428. #ifdef _WIN32
  1429. "-netdev tap,id=str,ifname=name\n"
  1430. " configure a host TAP network backend with ID 'str'\n"
  1431. #else
  1432. "-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n"
  1433. " [,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n"
  1434. " [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n"
  1435. " [,poll-us=n]\n"
  1436. " configure a host TAP network backend with ID 'str'\n"
  1437. " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
  1438. " use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n"
  1439. " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
  1440. " to deconfigure it\n"
  1441. " use '[down]script=no' to disable script execution\n"
  1442. " use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
  1443. " configure it\n"
  1444. " use 'fd=h' to connect to an already opened TAP interface\n"
  1445. " use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n"
  1446. " use 'sndbuf=nbytes' to limit the size of the send buffer (the\n"
  1447. " default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n"
  1448. " use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n"
  1449. " use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n"
  1450. " use vhost=on to enable experimental in kernel accelerator\n"
  1451. " (only has effect for virtio guests which use MSIX)\n"
  1452. " use vhostforce=on to force vhost on for non-MSIX virtio guests\n"
  1453. " use 'vhostfd=h' to connect to an already opened vhost net device\n"
  1454. " use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n"
  1455. " use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n"
  1456. " use 'poll-us=n' to speciy the maximum number of microseconds that could be\n"
  1457. " spent on busy polling for vhost net\n"
  1458. "-netdev bridge,id=str[,br=bridge][,helper=helper]\n"
  1459. " configure a host TAP network backend with ID 'str' that is\n"
  1460. " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
  1461. " using the program 'helper (default=" DEFAULT_BRIDGE_HELPER ")\n"
  1462. #endif
  1463. #ifdef __linux__
  1464. "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n"
  1465. " [,rxsession=rxsession],txsession=txsession[,ipv6=on/off][,udp=on/off]\n"
  1466. " [,cookie64=on/off][,counter][,pincounter][,txcookie=txcookie]\n"
  1467. " [,rxcookie=rxcookie][,offset=offset]\n"
  1468. " configure a network backend with ID 'str' connected to\n"
  1469. " an Ethernet over L2TPv3 pseudowire.\n"
  1470. " Linux kernel 3.3+ as well as most routers can talk\n"
  1471. " L2TPv3. This transport allows connecting a VM to a VM,\n"
  1472. " VM to a router and even VM to Host. It is a nearly-universal\n"
  1473. " standard (RFC3391). Note - this implementation uses static\n"
  1474. " pre-configured tunnels (same as the Linux kernel).\n"
  1475. " use 'src=' to specify source address\n"
  1476. " use 'dst=' to specify destination address\n"
  1477. " use 'udp=on' to specify udp encapsulation\n"
  1478. " use 'srcport=' to specify source udp port\n"
  1479. " use 'dstport=' to specify destination udp port\n"
  1480. " use 'ipv6=on' to force v6\n"
  1481. " L2TPv3 uses cookies to prevent misconfiguration as\n"
  1482. " well as a weak security measure\n"
  1483. " use 'rxcookie=0x012345678' to specify a rxcookie\n"
  1484. " use 'txcookie=0x012345678' to specify a txcookie\n"
  1485. " use 'cookie64=on' to set cookie size to 64 bit, otherwise 32\n"
  1486. " use 'counter=off' to force a 'cut-down' L2TPv3 with no counter\n"
  1487. " use 'pincounter=on' to work around broken counter handling in peer\n"
  1488. " use 'offset=X' to add an extra offset between header and data\n"
  1489. #endif
  1490. "-netdev socket,id=str[,fd=h][,listen=[host]:port][,connect=host:port]\n"
  1491. " configure a network backend to connect to another network\n"
  1492. " using a socket connection\n"
  1493. "-netdev socket,id=str[,fd=h][,mcast=maddr:port[,localaddr=addr]]\n"
  1494. " configure a network backend to connect to a multicast maddr and port\n"
  1495. " use 'localaddr=addr' to specify the host address to send packets from\n"
  1496. "-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n"
  1497. " configure a network backend to connect to another network\n"
  1498. " using an UDP tunnel\n"
  1499. #ifdef CONFIG_VDE
  1500. "-netdev vde,id=str[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n"
  1501. " configure a network backend to connect to port 'n' of a vde switch\n"
  1502. " running on host and listening for incoming connections on 'socketpath'.\n"
  1503. " Use group 'groupname' and mode 'octalmode' to change default\n"
  1504. " ownership and permissions for communication port.\n"
  1505. #endif
  1506. #ifdef CONFIG_NETMAP
  1507. "-netdev netmap,id=str,ifname=name[,devname=nmname]\n"
  1508. " attach to the existing netmap-enabled network interface 'name', or to a\n"
  1509. " VALE port (created on the fly) called 'name' ('nmname' is name of the \n"
  1510. " netmap device, defaults to '/dev/netmap')\n"
  1511. #endif
  1512. "-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n"
  1513. " configure a vhost-user network, backed by a chardev 'dev'\n"
  1514. "-netdev hubport,id=str,hubid=n\n"
  1515. " configure a hub port on QEMU VLAN 'n'\n", QEMU_ARCH_ALL)
  1516. DEF("net", HAS_ARG, QEMU_OPTION_net,
  1517. "-net nic[,vlan=n][,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n"
  1518. " old way to create a new NIC and connect it to VLAN 'n'\n"
  1519. " (use the '-device devtype,netdev=str' option if possible instead)\n"
  1520. "-net dump[,vlan=n][,file=f][,len=n]\n"
  1521. " dump traffic on vlan 'n' to file 'f' (max n bytes per packet)\n"
  1522. "-net none use it alone to have zero network devices. If no -net option\n"
  1523. " is provided, the default is '-net nic -net user'\n"
  1524. "-net ["
  1525. #ifdef CONFIG_SLIRP
  1526. "user|"
  1527. #endif
  1528. "tap|"
  1529. "bridge|"
  1530. #ifdef CONFIG_VDE
  1531. "vde|"
  1532. #endif
  1533. #ifdef CONFIG_NETMAP
  1534. "netmap|"
  1535. #endif
  1536. "socket][,vlan=n][,option][,option][,...]\n"
  1537. " old way to initialize a host network interface\n"
  1538. " (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL)
  1539. STEXI
  1540. @item -net nic[,vlan=@var{n}][,macaddr=@var{mac}][,model=@var{type}] [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}]
  1541. @findex -net
  1542. Create a new Network Interface Card and connect it to VLAN @var{n} (@var{n}
  1543. = 0 is the default). The NIC is an e1000 by default on the PC
  1544. target. Optionally, the MAC address can be changed to @var{mac}, the
  1545. device address set to @var{addr} (PCI cards only),
  1546. and a @var{name} can be assigned for use in monitor commands.
  1547. Optionally, for PCI cards, you can specify the number @var{v} of MSI-X vectors
  1548. that the card should have; this option currently only affects virtio cards; set
  1549. @var{v} = 0 to disable MSI-X. If no @option{-net} option is specified, a single
  1550. NIC is created. QEMU can emulate several different models of network card.
  1551. Valid values for @var{type} are
  1552. @code{virtio}, @code{i82551}, @code{i82557b}, @code{i82559er},
  1553. @code{ne2k_pci}, @code{ne2k_isa}, @code{pcnet}, @code{rtl8139},
  1554. @code{e1000}, @code{smc91c111}, @code{lance} and @code{mcf_fec}.
  1555. Not all devices are supported on all targets. Use @code{-net nic,model=help}
  1556. for a list of available devices for your target.
  1557. @item -netdev user,id=@var{id}[,@var{option}][,@var{option}][,...]
  1558. @findex -netdev
  1559. @item -net user[,@var{option}][,@var{option}][,...]
  1560. Use the user mode network stack which requires no administrator
  1561. privilege to run. Valid options are:
  1562. @table @option
  1563. @item vlan=@var{n}
  1564. Connect user mode stack to VLAN @var{n} (@var{n} = 0 is the default).
  1565. @item id=@var{id}
  1566. @itemx name=@var{name}
  1567. Assign symbolic name for use in monitor commands.
  1568. @option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must
  1569. be enabled. If neither is specified both protocols are enabled.
  1570. @item net=@var{addr}[/@var{mask}]
  1571. Set IP network address the guest will see. Optionally specify the netmask,
  1572. either in the form a.b.c.d or as number of valid top-most bits. Default is
  1573. 10.0.2.0/24.
  1574. @item host=@var{addr}
  1575. Specify the guest-visible address of the host. Default is the 2nd IP in the
  1576. guest network, i.e. x.x.x.2.
  1577. @item ipv6-net=@var{addr}[/@var{int}]
  1578. Set IPv6 network address the guest will see (default is fec0::/64). The
  1579. network prefix is given in the usual hexadecimal IPv6 address
  1580. notation. The prefix size is optional, and is given as the number of
  1581. valid top-most bits (default is 64).
  1582. @item ipv6-host=@var{addr}
  1583. Specify the guest-visible IPv6 address of the host. Default is the 2nd IPv6 in
  1584. the guest network, i.e. xxxx::2.
  1585. @item restrict=on|off
  1586. If this option is enabled, the guest will be isolated, i.e. it will not be
  1587. able to contact the host and no guest IP packets will be routed over the host
  1588. to the outside. This option does not affect any explicitly set forwarding rules.
  1589. @item hostname=@var{name}
  1590. Specifies the client hostname reported by the built-in DHCP server.
  1591. @item dhcpstart=@var{addr}
  1592. Specify the first of the 16 IPs the built-in DHCP server can assign. Default
  1593. is the 15th to 31st IP in the guest network, i.e. x.x.x.15 to x.x.x.31.
  1594. @item dns=@var{addr}
  1595. Specify the guest-visible address of the virtual nameserver. The address must
  1596. be different from the host address. Default is the 3rd IP in the guest network,
  1597. i.e. x.x.x.3.
  1598. @item ipv6-dns=@var{addr}
  1599. Specify the guest-visible address of the IPv6 virtual nameserver. The address
  1600. must be different from the host address. Default is the 3rd IP in the guest
  1601. network, i.e. xxxx::3.
  1602. @item dnssearch=@var{domain}
  1603. Provides an entry for the domain-search list sent by the built-in
  1604. DHCP server. More than one domain suffix can be transmitted by specifying
  1605. this option multiple times. If supported, this will cause the guest to
  1606. automatically try to append the given domain suffix(es) in case a domain name
  1607. can not be resolved.
  1608. Example:
  1609. @example
  1610. qemu -net user,dnssearch=mgmt.example.org,dnssearch=example.org [...]
  1611. @end example
  1612. @item tftp=@var{dir}
  1613. When using the user mode network stack, activate a built-in TFTP
  1614. server. The files in @var{dir} will be exposed as the root of a TFTP server.
  1615. The TFTP client on the guest must be configured in binary mode (use the command
  1616. @code{bin} of the Unix TFTP client).
  1617. @item bootfile=@var{file}
  1618. When using the user mode network stack, broadcast @var{file} as the BOOTP
  1619. filename. In conjunction with @option{tftp}, this can be used to network boot
  1620. a guest from a local directory.
  1621. Example (using pxelinux):
  1622. @example
  1623. qemu-system-i386 -hda linux.img -boot n -net user,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
  1624. @end example
  1625. @item smb=@var{dir}[,smbserver=@var{addr}]
  1626. When using the user mode network stack, activate a built-in SMB
  1627. server so that Windows OSes can access to the host files in @file{@var{dir}}
  1628. transparently. The IP address of the SMB server can be set to @var{addr}. By
  1629. default the 4th IP in the guest network is used, i.e. x.x.x.4.
  1630. In the guest Windows OS, the line:
  1631. @example
  1632. 10.0.2.4 smbserver
  1633. @end example
  1634. must be added in the file @file{C:\WINDOWS\LMHOSTS} (for windows 9x/Me)
  1635. or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).
  1636. Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.
  1637. Note that a SAMBA server must be installed on the host OS.
  1638. QEMU was tested successfully with smbd versions from Red Hat 9,
  1639. Fedora Core 3 and OpenSUSE 11.x.
  1640. @item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport}
  1641. Redirect incoming TCP or UDP connections to the host port @var{hostport} to
  1642. the guest IP address @var{guestaddr} on guest port @var{guestport}. If
  1643. @var{guestaddr} is not specified, its value is x.x.x.15 (default first address
  1644. given by the built-in DHCP server). By specifying @var{hostaddr}, the rule can
  1645. be bound to a specific host interface. If no connection type is set, TCP is
  1646. used. This option can be given multiple times.
  1647. For example, to redirect host X11 connection from screen 1 to guest
  1648. screen 0, use the following:
  1649. @example
  1650. # on the host
  1651. qemu-system-i386 -net user,hostfwd=tcp:127.0.0.1:6001-:6000 [...]
  1652. # this host xterm should open in the guest X11 server
  1653. xterm -display :1
  1654. @end example
  1655. To redirect telnet connections from host port 5555 to telnet port on
  1656. the guest, use the following:
  1657. @example
  1658. # on the host
  1659. qemu-system-i386 -net user,hostfwd=tcp::5555-:23 [...]
  1660. telnet localhost 5555
  1661. @end example
  1662. Then when you use on the host @code{telnet localhost 5555}, you
  1663. connect to the guest telnet server.
  1664. @item guestfwd=[tcp]:@var{server}:@var{port}-@var{dev}
  1665. @itemx guestfwd=[tcp]:@var{server}:@var{port}-@var{cmd:command}
  1666. Forward guest TCP connections to the IP address @var{server} on port @var{port}
  1667. to the character device @var{dev} or to a program executed by @var{cmd:command}
  1668. which gets spawned for each connection. This option can be given multiple times.
  1669. You can either use a chardev directly and have that one used throughout QEMU's
  1670. lifetime, like in the following example:
  1671. @example
  1672. # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever
  1673. # the guest accesses it
  1674. qemu -net user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321 [...]
  1675. @end example
  1676. Or you can execute a command on every TCP connection established by the guest,
  1677. so that QEMU behaves similar to an inetd process for that virtual server:
  1678. @example
  1679. # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234
  1680. # and connect the TCP stream to its stdin/stdout
  1681. qemu -net 'user,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321'
  1682. @end example
  1683. @end table
  1684. Note: Legacy stand-alone options -tftp, -bootp, -smb and -redir are still
  1685. processed and applied to -net user. Mixing them with the new configuration
  1686. syntax gives undefined results. Their use for new applications is discouraged
  1687. as they will be removed from future versions.
  1688. @item -netdev tap,id=@var{id}[,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,br=@var{bridge}][,helper=@var{helper}]
  1689. @itemx -net tap[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,br=@var{bridge}][,helper=@var{helper}]
  1690. Connect the host TAP network interface @var{name} to VLAN @var{n}.
  1691. Use the network script @var{file} to configure it and the network script
  1692. @var{dfile} to deconfigure it. If @var{name} is not provided, the OS
  1693. automatically provides one. The default network configure script is
  1694. @file{/etc/qemu-ifup} and the default network deconfigure script is
  1695. @file{/etc/qemu-ifdown}. Use @option{script=no} or @option{downscript=no}
  1696. to disable script execution.
  1697. If running QEMU as an unprivileged user, use the network helper
  1698. @var{helper} to configure the TAP interface and attach it to the bridge.
  1699. The default network helper executable is @file{/path/to/qemu-bridge-helper}
  1700. and the default bridge device is @file{br0}.
  1701. @option{fd}=@var{h} can be used to specify the handle of an already
  1702. opened host TAP interface.
  1703. Examples:
  1704. @example
  1705. #launch a QEMU instance with the default network script
  1706. qemu-system-i386 linux.img -net nic -net tap
  1707. @end example
  1708. @example
  1709. #launch a QEMU instance with two NICs, each one connected
  1710. #to a TAP device
  1711. qemu-system-i386 linux.img \
  1712. -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \
  1713. -net nic,vlan=1 -net tap,vlan=1,ifname=tap1
  1714. @end example
  1715. @example
  1716. #launch a QEMU instance with the default network helper to
  1717. #connect a TAP device to bridge br0
  1718. qemu-system-i386 linux.img \
  1719. -net nic -net tap,"helper=/path/to/qemu-bridge-helper"
  1720. @end example
  1721. @item -netdev bridge,id=@var{id}[,br=@var{bridge}][,helper=@var{helper}]
  1722. @itemx -net bridge[,vlan=@var{n}][,name=@var{name}][,br=@var{bridge}][,helper=@var{helper}]
  1723. Connect a host TAP network interface to a host bridge device.
  1724. Use the network helper @var{helper} to configure the TAP interface and
  1725. attach it to the bridge. The default network helper executable is
  1726. @file{/path/to/qemu-bridge-helper} and the default bridge
  1727. device is @file{br0}.
  1728. Examples:
  1729. @example
  1730. #launch a QEMU instance with the default network helper to
  1731. #connect a TAP device to bridge br0
  1732. qemu-system-i386 linux.img -net bridge -net nic,model=virtio
  1733. @end example
  1734. @example
  1735. #launch a QEMU instance with the default network helper to
  1736. #connect a TAP device to bridge qemubr0
  1737. qemu-system-i386 linux.img -net bridge,br=qemubr0 -net nic,model=virtio
  1738. @end example
  1739. @item -netdev socket,id=@var{id}[,fd=@var{h}][,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}]
  1740. @itemx -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}] [,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}]
  1741. Connect the VLAN @var{n} to a remote VLAN in another QEMU virtual
  1742. machine using a TCP socket connection. If @option{listen} is
  1743. specified, QEMU waits for incoming connections on @var{port}
  1744. (@var{host} is optional). @option{connect} is used to connect to
  1745. another QEMU instance using the @option{listen} option. @option{fd}=@var{h}
  1746. specifies an already opened TCP socket.
  1747. Example:
  1748. @example
  1749. # launch a first QEMU instance
  1750. qemu-system-i386 linux.img \
  1751. -net nic,macaddr=52:54:00:12:34:56 \
  1752. -net socket,listen=:1234
  1753. # connect the VLAN 0 of this instance to the VLAN 0
  1754. # of the first instance
  1755. qemu-system-i386 linux.img \
  1756. -net nic,macaddr=52:54:00:12:34:57 \
  1757. -net socket,connect=127.0.0.1:1234
  1758. @end example
  1759. @item -netdev socket,id=@var{id}[,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]]
  1760. @itemx -net socket[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,mcast=@var{maddr}:@var{port}[,localaddr=@var{addr}]]
  1761. Create a VLAN @var{n} shared with another QEMU virtual
  1762. machines using a UDP multicast socket, effectively making a bus for
  1763. every QEMU with same multicast address @var{maddr} and @var{port}.
  1764. NOTES:
  1765. @enumerate
  1766. @item
  1767. Several QEMU can be running on different hosts and share same bus (assuming
  1768. correct multicast setup for these hosts).
  1769. @item
  1770. mcast support is compatible with User Mode Linux (argument @option{eth@var{N}=mcast}), see
  1771. @url{http://user-mode-linux.sf.net}.
  1772. @item
  1773. Use @option{fd=h} to specify an already opened UDP multicast socket.
  1774. @end enumerate
  1775. Example:
  1776. @example
  1777. # launch one QEMU instance
  1778. qemu-system-i386 linux.img \
  1779. -net nic,macaddr=52:54:00:12:34:56 \
  1780. -net socket,mcast=230.0.0.1:1234
  1781. # launch another QEMU instance on same "bus"
  1782. qemu-system-i386 linux.img \
  1783. -net nic,macaddr=52:54:00:12:34:57 \
  1784. -net socket,mcast=230.0.0.1:1234
  1785. # launch yet another QEMU instance on same "bus"
  1786. qemu-system-i386 linux.img \
  1787. -net nic,macaddr=52:54:00:12:34:58 \
  1788. -net socket,mcast=230.0.0.1:1234
  1789. @end example
  1790. Example (User Mode Linux compat.):
  1791. @example
  1792. # launch QEMU instance (note mcast address selected
  1793. # is UML's default)
  1794. qemu-system-i386 linux.img \
  1795. -net nic,macaddr=52:54:00:12:34:56 \
  1796. -net socket,mcast=239.192.168.1:1102
  1797. # launch UML
  1798. /path/to/linux ubd0=/path/to/root_fs eth0=mcast
  1799. @end example
  1800. Example (send packets from host's 1.2.3.4):
  1801. @example
  1802. qemu-system-i386 linux.img \
  1803. -net nic,macaddr=52:54:00:12:34:56 \
  1804. -net socket,mcast=239.192.168.1:1102,localaddr=1.2.3.4
  1805. @end example
  1806. @item -netdev l2tpv3,id=@var{id},src=@var{srcaddr},dst=@var{dstaddr}[,srcport=@var{srcport}][,dstport=@var{dstport}],txsession=@var{txsession}[,rxsession=@var{rxsession}][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=@var{txcookie}][,rxcookie=@var{rxcookie}][,offset=@var{offset}]
  1807. @itemx -net l2tpv3[,vlan=@var{n}][,name=@var{name}],src=@var{srcaddr},dst=@var{dstaddr}[,srcport=@var{srcport}][,dstport=@var{dstport}],txsession=@var{txsession}[,rxsession=@var{rxsession}][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=@var{txcookie}][,rxcookie=@var{rxcookie}][,offset=@var{offset}]
  1808. Connect VLAN @var{n} to L2TPv3 pseudowire. L2TPv3 (RFC3391) is a popular
  1809. protocol to transport Ethernet (and other Layer 2) data frames between
  1810. two systems. It is present in routers, firewalls and the Linux kernel
  1811. (from version 3.3 onwards).
  1812. This transport allows a VM to communicate to another VM, router or firewall directly.
  1813. @item src=@var{srcaddr}
  1814. source address (mandatory)
  1815. @item dst=@var{dstaddr}
  1816. destination address (mandatory)
  1817. @item udp
  1818. select udp encapsulation (default is ip).
  1819. @item srcport=@var{srcport}
  1820. source udp port.
  1821. @item dstport=@var{dstport}
  1822. destination udp port.
  1823. @item ipv6
  1824. force v6, otherwise defaults to v4.
  1825. @item rxcookie=@var{rxcookie}
  1826. @itemx txcookie=@var{txcookie}
  1827. Cookies are a weak form of security in the l2tpv3 specification.
  1828. Their function is mostly to prevent misconfiguration. By default they are 32
  1829. bit.
  1830. @item cookie64
  1831. Set cookie size to 64 bit instead of the default 32
  1832. @item counter=off
  1833. Force a 'cut-down' L2TPv3 with no counter as in
  1834. draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00
  1835. @item pincounter=on
  1836. Work around broken counter handling in peer. This may also help on
  1837. networks which have packet reorder.
  1838. @item offset=@var{offset}
  1839. Add an extra offset between header and data
  1840. For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to the bridge br-lan
  1841. on the remote Linux host 1.2.3.4:
  1842. @example
  1843. # Setup tunnel on linux host using raw ip as encapsulation
  1844. # on 1.2.3.4
  1845. ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \
  1846. encap udp udp_sport 16384 udp_dport 16384
  1847. ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \
  1848. 0xFFFFFFFF peer_session_id 0xFFFFFFFF
  1849. ifconfig vmtunnel0 mtu 1500
  1850. ifconfig vmtunnel0 up
  1851. brctl addif br-lan vmtunnel0
  1852. # on 4.3.2.1
  1853. # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter
  1854. qemu-system-i386 linux.img -net nic -net l2tpv3,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter
  1855. @end example
  1856. @item -netdev vde,id=@var{id}[,sock=@var{socketpath}][,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}]
  1857. @itemx -net vde[,vlan=@var{n}][,name=@var{name}][,sock=@var{socketpath}] [,port=@var{n}][,group=@var{groupname}][,mode=@var{octalmode}]
  1858. Connect VLAN @var{n} to PORT @var{n} of a vde switch running on host and
  1859. listening for incoming connections on @var{socketpath}. Use GROUP @var{groupname}
  1860. and MODE @var{octalmode} to change default ownership and permissions for
  1861. communication port. This option is only available if QEMU has been compiled
  1862. with vde support enabled.
  1863. Example:
  1864. @example
  1865. # launch vde switch
  1866. vde_switch -F -sock /tmp/myswitch
  1867. # launch QEMU instance
  1868. qemu-system-i386 linux.img -net nic -net vde,sock=/tmp/myswitch
  1869. @end example
  1870. @item -netdev hubport,id=@var{id},hubid=@var{hubid}
  1871. Create a hub port on QEMU "vlan" @var{hubid}.
  1872. The hubport netdev lets you connect a NIC to a QEMU "vlan" instead of a single
  1873. netdev. @code{-net} and @code{-device} with parameter @option{vlan} create the
  1874. required hub automatically.
  1875. @item -netdev vhost-user,chardev=@var{id}[,vhostforce=on|off][,queues=n]
  1876. Establish a vhost-user netdev, backed by a chardev @var{id}. The chardev should
  1877. be a unix domain socket backed one. The vhost-user uses a specifically defined
  1878. protocol to pass vhost ioctl replacement messages to an application on the other
  1879. end of the socket. On non-MSIX guests, the feature can be forced with
  1880. @var{vhostforce}. Use 'queues=@var{n}' to specify the number of queues to
  1881. be created for multiqueue vhost-user.
  1882. Example:
  1883. @example
  1884. qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \
  1885. -numa node,memdev=mem \
  1886. -chardev socket,id=chr0,path=/path/to/socket \
  1887. -netdev type=vhost-user,id=net0,chardev=chr0 \
  1888. -device virtio-net-pci,netdev=net0
  1889. @end example
  1890. @item -net dump[,vlan=@var{n}][,file=@var{file}][,len=@var{len}]
  1891. Dump network traffic on VLAN @var{n} to file @var{file} (@file{qemu-vlan0.pcap} by default).
  1892. At most @var{len} bytes (64k by default) per packet are stored. The file format is
  1893. libpcap, so it can be analyzed with tools such as tcpdump or Wireshark.
  1894. Note: For devices created with '-netdev', use '-object filter-dump,...' instead.
  1895. @item -net none
  1896. Indicate that no network devices should be configured. It is used to
  1897. override the default configuration (@option{-net nic -net user}) which
  1898. is activated if no @option{-net} options are provided.
  1899. ETEXI
  1900. STEXI
  1901. @end table
  1902. ETEXI
  1903. DEFHEADING()
  1904. DEFHEADING(Character device options)
  1905. STEXI
  1906. The general form of a character device option is:
  1907. @table @option
  1908. ETEXI
  1909. DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
  1910. "-chardev help\n"
  1911. "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  1912. "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4][,ipv6][,nodelay][,reconnect=seconds]\n"
  1913. " [,server][,nowait][,telnet][,reconnect=seconds][,mux=on|off]\n"
  1914. " [,logfile=PATH][,logappend=on|off][,tls-creds=ID] (tcp)\n"
  1915. "-chardev socket,id=id,path=path[,server][,nowait][,telnet][,reconnect=seconds]\n"
  1916. " [,mux=on|off][,logfile=PATH][,logappend=on|off] (unix)\n"
  1917. "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n"
  1918. " [,localport=localport][,ipv4][,ipv6][,mux=on|off]\n"
  1919. " [,logfile=PATH][,logappend=on|off]\n"
  1920. "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  1921. "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n"
  1922. " [,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  1923. "-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n"
  1924. "-chardev file,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  1925. "-chardev pipe,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  1926. #ifdef _WIN32
  1927. "-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  1928. "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  1929. #else
  1930. "-chardev pty,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  1931. "-chardev stdio,id=id[,mux=on|off][,signal=on|off][,logfile=PATH][,logappend=on|off]\n"
  1932. #endif
  1933. #ifdef CONFIG_BRLAPI
  1934. "-chardev braille,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  1935. #endif
  1936. #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
  1937. || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
  1938. "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  1939. "-chardev tty,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  1940. #endif
  1941. #if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
  1942. "-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  1943. "-chardev parport,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  1944. #endif
  1945. #if defined(CONFIG_SPICE)
  1946. "-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
  1947. "-chardev spiceport,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
  1948. #endif
  1949. , QEMU_ARCH_ALL
  1950. )
  1951. STEXI
  1952. @item -chardev @var{backend} ,id=@var{id} [,mux=on|off] [,@var{options}]
  1953. @findex -chardev
  1954. Backend is one of:
  1955. @option{null},
  1956. @option{socket},
  1957. @option{udp},
  1958. @option{msmouse},
  1959. @option{vc},
  1960. @option{ringbuf},
  1961. @option{file},
  1962. @option{pipe},
  1963. @option{console},
  1964. @option{serial},
  1965. @option{pty},
  1966. @option{stdio},
  1967. @option{braille},
  1968. @option{tty},
  1969. @option{parallel},
  1970. @option{parport},
  1971. @option{spicevmc}.
  1972. @option{spiceport}.
  1973. The specific backend will determine the applicable options.
  1974. Use "-chardev help" to print all available chardev backend types.
  1975. All devices must have an id, which can be any string up to 127 characters long.
  1976. It is used to uniquely identify this device in other command line directives.
  1977. A character device may be used in multiplexing mode by multiple front-ends.
  1978. Specify @option{mux=on} to enable this mode.
  1979. A multiplexer is a "1:N" device, and here the "1" end is your specified chardev
  1980. backend, and the "N" end is the various parts of QEMU that can talk to a chardev.
  1981. If you create a chardev with @option{id=myid} and @option{mux=on}, QEMU will
  1982. create a multiplexer with your specified ID, and you can then configure multiple
  1983. front ends to use that chardev ID for their input/output. Up to four different
  1984. front ends can be connected to a single multiplexed chardev. (Without
  1985. multiplexing enabled, a chardev can only be used by a single front end.)
  1986. For instance you could use this to allow a single stdio chardev to be used by
  1987. two serial ports and the QEMU monitor:
  1988. @example
  1989. -chardev stdio,mux=on,id=char0 \
  1990. -mon chardev=char0,mode=readline \
  1991. -serial chardev:char0 \
  1992. -serial chardev:char0
  1993. @end example
  1994. You can have more than one multiplexer in a system configuration; for instance
  1995. you could have a TCP port multiplexed between UART 0 and UART 1, and stdio
  1996. multiplexed between the QEMU monitor and a parallel port:
  1997. @example
  1998. -chardev stdio,mux=on,id=char0 \
  1999. -mon chardev=char0,mode=readline \
  2000. -parallel chardev:char0 \
  2001. -chardev tcp,...,mux=on,id=char1 \
  2002. -serial chardev:char1 \
  2003. -serial chardev:char1
  2004. @end example
  2005. When you're using a multiplexed character device, some escape sequences are
  2006. interpreted in the input. @xref{mux_keys, Keys in the character backend
  2007. multiplexer}.
  2008. Note that some other command line options may implicitly create multiplexed
  2009. character backends; for instance @option{-serial mon:stdio} creates a
  2010. multiplexed stdio backend connected to the serial port and the QEMU monitor,
  2011. and @option{-nographic} also multiplexes the console and the monitor to
  2012. stdio.
  2013. There is currently no support for multiplexing in the other direction
  2014. (where a single QEMU front end takes input and output from multiple chardevs).
  2015. Every backend supports the @option{logfile} option, which supplies the path
  2016. to a file to record all data transmitted via the backend. The @option{logappend}
  2017. option controls whether the log file will be truncated or appended to when
  2018. opened.
  2019. Further options to each backend are described below.
  2020. @item -chardev null ,id=@var{id}
  2021. A void device. This device will not emit any data, and will drop any data it
  2022. receives. The null backend does not take any options.
  2023. @item -chardev socket ,id=@var{id} [@var{TCP options} or @var{unix options}] [,server] [,nowait] [,telnet] [,reconnect=@var{seconds}] [,tls-creds=@var{id}]
  2024. Create a two-way stream socket, which can be either a TCP or a unix socket. A
  2025. unix socket will be created if @option{path} is specified. Behaviour is
  2026. undefined if TCP options are specified for a unix socket.
  2027. @option{server} specifies that the socket shall be a listening socket.
  2028. @option{nowait} specifies that QEMU should not block waiting for a client to
  2029. connect to a listening socket.
  2030. @option{telnet} specifies that traffic on the socket should interpret telnet
  2031. escape sequences.
  2032. @option{reconnect} sets the timeout for reconnecting on non-server sockets when
  2033. the remote end goes away. qemu will delay this many seconds and then attempt
  2034. to reconnect. Zero disables reconnecting, and is the default.
  2035. @option{tls-creds} requests enablement of the TLS protocol for encryption,
  2036. and specifies the id of the TLS credentials to use for the handshake. The
  2037. credentials must be previously created with the @option{-object tls-creds}
  2038. argument.
  2039. TCP and unix socket options are given below:
  2040. @table @option
  2041. @item TCP options: port=@var{port} [,host=@var{host}] [,to=@var{to}] [,ipv4] [,ipv6] [,nodelay]
  2042. @option{host} for a listening socket specifies the local address to be bound.
  2043. For a connecting socket species the remote host to connect to. @option{host} is
  2044. optional for listening sockets. If not specified it defaults to @code{0.0.0.0}.
  2045. @option{port} for a listening socket specifies the local port to be bound. For a
  2046. connecting socket specifies the port on the remote host to connect to.
  2047. @option{port} can be given as either a port number or a service name.
  2048. @option{port} is required.
  2049. @option{to} is only relevant to listening sockets. If it is specified, and
  2050. @option{port} cannot be bound, QEMU will attempt to bind to subsequent ports up
  2051. to and including @option{to} until it succeeds. @option{to} must be specified
  2052. as a port number.
  2053. @option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used.
  2054. If neither is specified the socket may use either protocol.
  2055. @option{nodelay} disables the Nagle algorithm.
  2056. @item unix options: path=@var{path}
  2057. @option{path} specifies the local path of the unix socket. @option{path} is
  2058. required.
  2059. @end table
  2060. @item -chardev udp ,id=@var{id} [,host=@var{host}] ,port=@var{port} [,localaddr=@var{localaddr}] [,localport=@var{localport}] [,ipv4] [,ipv6]
  2061. Sends all traffic from the guest to a remote host over UDP.
  2062. @option{host} specifies the remote host to connect to. If not specified it
  2063. defaults to @code{localhost}.
  2064. @option{port} specifies the port on the remote host to connect to. @option{port}
  2065. is required.
  2066. @option{localaddr} specifies the local address to bind to. If not specified it
  2067. defaults to @code{0.0.0.0}.
  2068. @option{localport} specifies the local port to bind to. If not specified any
  2069. available local port will be used.
  2070. @option{ipv4} and @option{ipv6} specify that either IPv4 or IPv6 must be used.
  2071. If neither is specified the device may use either protocol.
  2072. @item -chardev msmouse ,id=@var{id}
  2073. Forward QEMU's emulated msmouse events to the guest. @option{msmouse} does not
  2074. take any options.
  2075. @item -chardev vc ,id=@var{id} [[,width=@var{width}] [,height=@var{height}]] [[,cols=@var{cols}] [,rows=@var{rows}]]
  2076. Connect to a QEMU text console. @option{vc} may optionally be given a specific
  2077. size.
  2078. @option{width} and @option{height} specify the width and height respectively of
  2079. the console, in pixels.
  2080. @option{cols} and @option{rows} specify that the console be sized to fit a text
  2081. console with the given dimensions.
  2082. @item -chardev ringbuf ,id=@var{id} [,size=@var{size}]
  2083. Create a ring buffer with fixed size @option{size}.
  2084. @var{size} must be a power of two and defaults to @code{64K}.
  2085. @item -chardev file ,id=@var{id} ,path=@var{path}
  2086. Log all traffic received from the guest to a file.
  2087. @option{path} specifies the path of the file to be opened. This file will be
  2088. created if it does not already exist, and overwritten if it does. @option{path}
  2089. is required.
  2090. @item -chardev pipe ,id=@var{id} ,path=@var{path}
  2091. Create a two-way connection to the guest. The behaviour differs slightly between
  2092. Windows hosts and other hosts:
  2093. On Windows, a single duplex pipe will be created at
  2094. @file{\\.pipe\@option{path}}.
  2095. On other hosts, 2 pipes will be created called @file{@option{path}.in} and
  2096. @file{@option{path}.out}. Data written to @file{@option{path}.in} will be
  2097. received by the guest. Data written by the guest can be read from
  2098. @file{@option{path}.out}. QEMU will not create these fifos, and requires them to
  2099. be present.
  2100. @option{path} forms part of the pipe path as described above. @option{path} is
  2101. required.
  2102. @item -chardev console ,id=@var{id}
  2103. Send traffic from the guest to QEMU's standard output. @option{console} does not
  2104. take any options.
  2105. @option{console} is only available on Windows hosts.
  2106. @item -chardev serial ,id=@var{id} ,path=@option{path}
  2107. Send traffic from the guest to a serial device on the host.
  2108. On Unix hosts serial will actually accept any tty device,
  2109. not only serial lines.
  2110. @option{path} specifies the name of the serial device to open.
  2111. @item -chardev pty ,id=@var{id}
  2112. Create a new pseudo-terminal on the host and connect to it. @option{pty} does
  2113. not take any options.
  2114. @option{pty} is not available on Windows hosts.
  2115. @item -chardev stdio ,id=@var{id} [,signal=on|off]
  2116. Connect to standard input and standard output of the QEMU process.
  2117. @option{signal} controls if signals are enabled on the terminal, that includes
  2118. exiting QEMU with the key sequence @key{Control-c}. This option is enabled by
  2119. default, use @option{signal=off} to disable it.
  2120. @item -chardev braille ,id=@var{id}
  2121. Connect to a local BrlAPI server. @option{braille} does not take any options.
  2122. @item -chardev tty ,id=@var{id} ,path=@var{path}
  2123. @option{tty} is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD and
  2124. DragonFlyBSD hosts. It is an alias for @option{serial}.
  2125. @option{path} specifies the path to the tty. @option{path} is required.
  2126. @item -chardev parallel ,id=@var{id} ,path=@var{path}
  2127. @itemx -chardev parport ,id=@var{id} ,path=@var{path}
  2128. @option{parallel} is only available on Linux, FreeBSD and DragonFlyBSD hosts.
  2129. Connect to a local parallel port.
  2130. @option{path} specifies the path to the parallel port device. @option{path} is
  2131. required.
  2132. @item -chardev spicevmc ,id=@var{id} ,debug=@var{debug}, name=@var{name}
  2133. @option{spicevmc} is only available when spice support is built in.
  2134. @option{debug} debug level for spicevmc
  2135. @option{name} name of spice channel to connect to
  2136. Connect to a spice virtual machine channel, such as vdiport.
  2137. @item -chardev spiceport ,id=@var{id} ,debug=@var{debug}, name=@var{name}
  2138. @option{spiceport} is only available when spice support is built in.
  2139. @option{debug} debug level for spicevmc
  2140. @option{name} name of spice port to connect to
  2141. Connect to a spice port, allowing a Spice client to handle the traffic
  2142. identified by a name (preferably a fqdn).
  2143. ETEXI
  2144. STEXI
  2145. @end table
  2146. ETEXI
  2147. DEFHEADING()
  2148. DEFHEADING(Device URL Syntax)
  2149. STEXI
  2150. In addition to using normal file images for the emulated storage devices,
  2151. QEMU can also use networked resources such as iSCSI devices. These are
  2152. specified using a special URL syntax.
  2153. @table @option
  2154. @item iSCSI
  2155. iSCSI support allows QEMU to access iSCSI resources directly and use as
  2156. images for the guest storage. Both disk and cdrom images are supported.
  2157. Syntax for specifying iSCSI LUNs is
  2158. ``iscsi://<target-ip>[:<port>]/<target-iqn>/<lun>''
  2159. By default qemu will use the iSCSI initiator-name
  2160. 'iqn.2008-11.org.linux-kvm[:<name>]' but this can also be set from the command
  2161. line or a configuration file.
  2162. Since version Qemu 2.4 it is possible to specify a iSCSI request timeout to detect
  2163. stalled requests and force a reestablishment of the session. The timeout
  2164. is specified in seconds. The default is 0 which means no timeout. Libiscsi
  2165. 1.15.0 or greater is required for this feature.
  2166. Example (without authentication):
  2167. @example
  2168. qemu-system-i386 -iscsi initiator-name=iqn.2001-04.com.example:my-initiator \
  2169. -cdrom iscsi://192.0.2.1/iqn.2001-04.com.example/2 \
  2170. -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1
  2171. @end example
  2172. Example (CHAP username/password via URL):
  2173. @example
  2174. qemu-system-i386 -drive file=iscsi://user%password@@192.0.2.1/iqn.2001-04.com.example/1
  2175. @end example
  2176. Example (CHAP username/password via environment variables):
  2177. @example
  2178. LIBISCSI_CHAP_USERNAME="user" \
  2179. LIBISCSI_CHAP_PASSWORD="password" \
  2180. qemu-system-i386 -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1
  2181. @end example
  2182. iSCSI support is an optional feature of QEMU and only available when
  2183. compiled and linked against libiscsi.
  2184. ETEXI
  2185. DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
  2186. "-iscsi [user=user][,password=password]\n"
  2187. " [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n"
  2188. " [,initiator-name=initiator-iqn][,id=target-iqn]\n"
  2189. " [,timeout=timeout]\n"
  2190. " iSCSI session parameters\n", QEMU_ARCH_ALL)
  2191. STEXI
  2192. iSCSI parameters such as username and password can also be specified via
  2193. a configuration file. See qemu-doc for more information and examples.
  2194. @item NBD
  2195. QEMU supports NBD (Network Block Devices) both using TCP protocol as well
  2196. as Unix Domain Sockets.
  2197. Syntax for specifying a NBD device using TCP
  2198. ``nbd:<server-ip>:<port>[:exportname=<export>]''
  2199. Syntax for specifying a NBD device using Unix Domain Sockets
  2200. ``nbd:unix:<domain-socket>[:exportname=<export>]''
  2201. Example for TCP
  2202. @example
  2203. qemu-system-i386 --drive file=nbd:192.0.2.1:30000
  2204. @end example
  2205. Example for Unix Domain Sockets
  2206. @example
  2207. qemu-system-i386 --drive file=nbd:unix:/tmp/nbd-socket
  2208. @end example
  2209. @item SSH
  2210. QEMU supports SSH (Secure Shell) access to remote disks.
  2211. Examples:
  2212. @example
  2213. qemu-system-i386 -drive file=ssh://user@@host/path/to/disk.img
  2214. qemu-system-i386 -drive file.driver=ssh,file.user=user,file.host=host,file.port=22,file.path=/path/to/disk.img
  2215. @end example
  2216. Currently authentication must be done using ssh-agent. Other
  2217. authentication methods may be supported in future.
  2218. @item Sheepdog
  2219. Sheepdog is a distributed storage system for QEMU.
  2220. QEMU supports using either local sheepdog devices or remote networked
  2221. devices.
  2222. Syntax for specifying a sheepdog device
  2223. @example
  2224. sheepdog[+tcp|+unix]://[host:port]/vdiname[?socket=path][#snapid|#tag]
  2225. @end example
  2226. Example
  2227. @example
  2228. qemu-system-i386 --drive file=sheepdog://192.0.2.1:30000/MyVirtualMachine
  2229. @end example
  2230. See also @url{https://sheepdog.github.io/sheepdog/}.
  2231. @item GlusterFS
  2232. GlusterFS is a user space distributed file system.
  2233. QEMU supports the use of GlusterFS volumes for hosting VM disk images using
  2234. TCP, Unix Domain Sockets and RDMA transport protocols.
  2235. Syntax for specifying a VM disk image on GlusterFS volume is
  2236. @example
  2237. URI:
  2238. gluster[+type]://[host[:port]]/volume/path[?socket=...][,debug=N][,logfile=...]
  2239. JSON:
  2240. 'json:@{"driver":"qcow2","file":@{"driver":"gluster","volume":"testvol","path":"a.img","debug":N,"logfile":"...",
  2241. @ "server":[@{"type":"tcp","host":"...","port":"..."@},
  2242. @ @{"type":"unix","socket":"..."@}]@}@}'
  2243. @end example
  2244. Example
  2245. @example
  2246. URI:
  2247. qemu-system-x86_64 --drive file=gluster://192.0.2.1/testvol/a.img,
  2248. @ file.debug=9,file.logfile=/var/log/qemu-gluster.log
  2249. JSON:
  2250. qemu-system-x86_64 'json:@{"driver":"qcow2",
  2251. @ "file":@{"driver":"gluster",
  2252. @ "volume":"testvol","path":"a.img",
  2253. @ "debug":9,"logfile":"/var/log/qemu-gluster.log",
  2254. @ "server":[@{"type":"tcp","host":"1.2.3.4","port":24007@},
  2255. @ @{"type":"unix","socket":"/var/run/glusterd.socket"@}]@}@}'
  2256. qemu-system-x86_64 -drive driver=qcow2,file.driver=gluster,file.volume=testvol,file.path=/path/a.img,
  2257. @ file.debug=9,file.logfile=/var/log/qemu-gluster.log,
  2258. @ file.server.0.type=tcp,file.server.0.host=1.2.3.4,file.server.0.port=24007,
  2259. @ file.server.1.type=unix,file.server.1.socket=/var/run/glusterd.socket
  2260. @end example
  2261. See also @url{http://www.gluster.org}.
  2262. @item HTTP/HTTPS/FTP/FTPS
  2263. QEMU supports read-only access to files accessed over http(s) and ftp(s).
  2264. Syntax using a single filename:
  2265. @example
  2266. <protocol>://[<username>[:<password>]@@]<host>/<path>
  2267. @end example
  2268. where:
  2269. @table @option
  2270. @item protocol
  2271. 'http', 'https', 'ftp', or 'ftps'.
  2272. @item username
  2273. Optional username for authentication to the remote server.
  2274. @item password
  2275. Optional password for authentication to the remote server.
  2276. @item host
  2277. Address of the remote server.
  2278. @item path
  2279. Path on the remote server, including any query string.
  2280. @end table
  2281. The following options are also supported:
  2282. @table @option
  2283. @item url
  2284. The full URL when passing options to the driver explicitly.
  2285. @item readahead
  2286. The amount of data to read ahead with each range request to the remote server.
  2287. This value may optionally have the suffix 'T', 'G', 'M', 'K', 'k' or 'b'. If it
  2288. does not have a suffix, it will be assumed to be in bytes. The value must be a
  2289. multiple of 512 bytes. It defaults to 256k.
  2290. @item sslverify
  2291. Whether to verify the remote server's certificate when connecting over SSL. It
  2292. can have the value 'on' or 'off'. It defaults to 'on'.
  2293. @item cookie
  2294. Send this cookie (it can also be a list of cookies separated by ';') with
  2295. each outgoing request. Only supported when using protocols such as HTTP
  2296. which support cookies, otherwise ignored.
  2297. @item timeout
  2298. Set the timeout in seconds of the CURL connection. This timeout is the time
  2299. that CURL waits for a response from the remote server to get the size of the
  2300. image to be downloaded. If not set, the default timeout of 5 seconds is used.
  2301. @end table
  2302. Note that when passing options to qemu explicitly, @option{driver} is the value
  2303. of <protocol>.
  2304. Example: boot from a remote Fedora 20 live ISO image
  2305. @example
  2306. qemu-system-x86_64 --drive media=cdrom,file=http://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-Desktop-x86_64-20-1.iso,readonly
  2307. qemu-system-x86_64 --drive media=cdrom,file.driver=http,file.url=http://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-Desktop-x86_64-20-1.iso,readonly
  2308. @end example
  2309. Example: boot from a remote Fedora 20 cloud image using a local overlay for
  2310. writes, copy-on-read, and a readahead of 64k
  2311. @example
  2312. qemu-img create -f qcow2 -o backing_file='json:@{"file.driver":"http",, "file.url":"https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Images/x86_64/Fedora-x86_64-20-20131211.1-sda.qcow2",, "file.readahead":"64k"@}' /tmp/Fedora-x86_64-20-20131211.1-sda.qcow2
  2313. qemu-system-x86_64 -drive file=/tmp/Fedora-x86_64-20-20131211.1-sda.qcow2,copy-on-read=on
  2314. @end example
  2315. Example: boot from an image stored on a VMware vSphere server with a self-signed
  2316. certificate using a local overlay for writes, a readahead of 64k and a timeout
  2317. of 10 seconds.
  2318. @example
  2319. qemu-img create -f qcow2 -o backing_file='json:@{"file.driver":"https",, "file.url":"https://user:password@@vsphere.example.com/folder/test/test-flat.vmdk?dcPath=Datacenter&dsName=datastore1",, "file.sslverify":"off",, "file.readahead":"64k",, "file.timeout":10@}' /tmp/test.qcow2
  2320. qemu-system-x86_64 -drive file=/tmp/test.qcow2
  2321. @end example
  2322. ETEXI
  2323. STEXI
  2324. @end table
  2325. ETEXI
  2326. DEFHEADING(Bluetooth(R) options)
  2327. STEXI
  2328. @table @option
  2329. ETEXI
  2330. DEF("bt", HAS_ARG, QEMU_OPTION_bt, \
  2331. "-bt hci,null dumb bluetooth HCI - doesn't respond to commands\n" \
  2332. "-bt hci,host[:id]\n" \
  2333. " use host's HCI with the given name\n" \
  2334. "-bt hci[,vlan=n]\n" \
  2335. " emulate a standard HCI in virtual scatternet 'n'\n" \
  2336. "-bt vhci[,vlan=n]\n" \
  2337. " add host computer to virtual scatternet 'n' using VHCI\n" \
  2338. "-bt device:dev[,vlan=n]\n" \
  2339. " emulate a bluetooth device 'dev' in scatternet 'n'\n",
  2340. QEMU_ARCH_ALL)
  2341. STEXI
  2342. @item -bt hci[...]
  2343. @findex -bt
  2344. Defines the function of the corresponding Bluetooth HCI. -bt options
  2345. are matched with the HCIs present in the chosen machine type. For
  2346. example when emulating a machine with only one HCI built into it, only
  2347. the first @code{-bt hci[...]} option is valid and defines the HCI's
  2348. logic. The Transport Layer is decided by the machine type. Currently
  2349. the machines @code{n800} and @code{n810} have one HCI and all other
  2350. machines have none.
  2351. @anchor{bt-hcis}
  2352. The following three types are recognized:
  2353. @table @option
  2354. @item -bt hci,null
  2355. (default) The corresponding Bluetooth HCI assumes no internal logic
  2356. and will not respond to any HCI commands or emit events.
  2357. @item -bt hci,host[:@var{id}]
  2358. (@code{bluez} only) The corresponding HCI passes commands / events
  2359. to / from the physical HCI identified by the name @var{id} (default:
  2360. @code{hci0}) on the computer running QEMU. Only available on @code{bluez}
  2361. capable systems like Linux.
  2362. @item -bt hci[,vlan=@var{n}]
  2363. Add a virtual, standard HCI that will participate in the Bluetooth
  2364. scatternet @var{n} (default @code{0}). Similarly to @option{-net}
  2365. VLANs, devices inside a bluetooth network @var{n} can only communicate
  2366. with other devices in the same network (scatternet).
  2367. @end table
  2368. @item -bt vhci[,vlan=@var{n}]
  2369. (Linux-host only) Create a HCI in scatternet @var{n} (default 0) attached
  2370. to the host bluetooth stack instead of to the emulated target. This
  2371. allows the host and target machines to participate in a common scatternet
  2372. and communicate. Requires the Linux @code{vhci} driver installed. Can
  2373. be used as following:
  2374. @example
  2375. qemu-system-i386 [...OPTIONS...] -bt hci,vlan=5 -bt vhci,vlan=5
  2376. @end example
  2377. @item -bt device:@var{dev}[,vlan=@var{n}]
  2378. Emulate a bluetooth device @var{dev} and place it in network @var{n}
  2379. (default @code{0}). QEMU can only emulate one type of bluetooth devices
  2380. currently:
  2381. @table @option
  2382. @item keyboard
  2383. Virtual wireless keyboard implementing the HIDP bluetooth profile.
  2384. @end table
  2385. ETEXI
  2386. STEXI
  2387. @end table
  2388. ETEXI
  2389. DEFHEADING()
  2390. #ifdef CONFIG_TPM
  2391. DEFHEADING(TPM device options)
  2392. DEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \
  2393. "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n"
  2394. " use path to provide path to a character device; default is /dev/tpm0\n"
  2395. " use cancel-path to provide path to TPM's cancel sysfs entry; if\n"
  2396. " not provided it will be searched for in /sys/class/misc/tpm?/device\n",
  2397. QEMU_ARCH_ALL)
  2398. STEXI
  2399. The general form of a TPM device option is:
  2400. @table @option
  2401. @item -tpmdev @var{backend} ,id=@var{id} [,@var{options}]
  2402. @findex -tpmdev
  2403. Backend type must be:
  2404. @option{passthrough}.
  2405. The specific backend type will determine the applicable options.
  2406. The @code{-tpmdev} option creates the TPM backend and requires a
  2407. @code{-device} option that specifies the TPM frontend interface model.
  2408. Options to each backend are described below.
  2409. Use 'help' to print all available TPM backend types.
  2410. @example
  2411. qemu -tpmdev help
  2412. @end example
  2413. @item -tpmdev passthrough, id=@var{id}, path=@var{path}, cancel-path=@var{cancel-path}
  2414. (Linux-host only) Enable access to the host's TPM using the passthrough
  2415. driver.
  2416. @option{path} specifies the path to the host's TPM device, i.e., on
  2417. a Linux host this would be @code{/dev/tpm0}.
  2418. @option{path} is optional and by default @code{/dev/tpm0} is used.
  2419. @option{cancel-path} specifies the path to the host TPM device's sysfs
  2420. entry allowing for cancellation of an ongoing TPM command.
  2421. @option{cancel-path} is optional and by default QEMU will search for the
  2422. sysfs entry to use.
  2423. Some notes about using the host's TPM with the passthrough driver:
  2424. The TPM device accessed by the passthrough driver must not be
  2425. used by any other application on the host.
  2426. Since the host's firmware (BIOS/UEFI) has already initialized the TPM,
  2427. the VM's firmware (BIOS/UEFI) will not be able to initialize the
  2428. TPM again and may therefore not show a TPM-specific menu that would
  2429. otherwise allow the user to configure the TPM, e.g., allow the user to
  2430. enable/disable or activate/deactivate the TPM.
  2431. Further, if TPM ownership is released from within a VM then the host's TPM
  2432. will get disabled and deactivated. To enable and activate the
  2433. TPM again afterwards, the host has to be rebooted and the user is
  2434. required to enter the firmware's menu to enable and activate the TPM.
  2435. If the TPM is left disabled and/or deactivated most TPM commands will fail.
  2436. To create a passthrough TPM use the following two options:
  2437. @example
  2438. -tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0
  2439. @end example
  2440. Note that the @code{-tpmdev} id is @code{tpm0} and is referenced by
  2441. @code{tpmdev=tpm0} in the device option.
  2442. @end table
  2443. ETEXI
  2444. DEFHEADING()
  2445. #endif
  2446. DEFHEADING(Linux/Multiboot boot specific)
  2447. STEXI
  2448. When using these options, you can use a given Linux or Multiboot
  2449. kernel without installing it in the disk image. It can be useful
  2450. for easier testing of various kernels.
  2451. @table @option
  2452. ETEXI
  2453. DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \
  2454. "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL)
  2455. STEXI
  2456. @item -kernel @var{bzImage}
  2457. @findex -kernel
  2458. Use @var{bzImage} as kernel image. The kernel can be either a Linux kernel
  2459. or in multiboot format.
  2460. ETEXI
  2461. DEF("append", HAS_ARG, QEMU_OPTION_append, \
  2462. "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL)
  2463. STEXI
  2464. @item -append @var{cmdline}
  2465. @findex -append
  2466. Use @var{cmdline} as kernel command line
  2467. ETEXI
  2468. DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \
  2469. "-initrd file use 'file' as initial ram disk\n", QEMU_ARCH_ALL)
  2470. STEXI
  2471. @item -initrd @var{file}
  2472. @findex -initrd
  2473. Use @var{file} as initial ram disk.
  2474. @item -initrd "@var{file1} arg=foo,@var{file2}"
  2475. This syntax is only available with multiboot.
  2476. Use @var{file1} and @var{file2} as modules and pass arg=foo as parameter to the
  2477. first module.
  2478. ETEXI
  2479. DEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \
  2480. "-dtb file use 'file' as device tree image\n", QEMU_ARCH_ALL)
  2481. STEXI
  2482. @item -dtb @var{file}
  2483. @findex -dtb
  2484. Use @var{file} as a device tree binary (dtb) image and pass it to the kernel
  2485. on boot.
  2486. ETEXI
  2487. STEXI
  2488. @end table
  2489. ETEXI
  2490. DEFHEADING()
  2491. DEFHEADING(Debug/Expert options)
  2492. STEXI
  2493. @table @option
  2494. ETEXI
  2495. DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
  2496. "-fw_cfg [name=]<name>,file=<file>\n"
  2497. " add named fw_cfg entry with contents from file\n"
  2498. "-fw_cfg [name=]<name>,string=<str>\n"
  2499. " add named fw_cfg entry with contents from string\n",
  2500. QEMU_ARCH_ALL)
  2501. STEXI
  2502. @item -fw_cfg [name=]@var{name},file=@var{file}
  2503. @findex -fw_cfg
  2504. Add named fw_cfg entry with contents from file @var{file}.
  2505. @item -fw_cfg [name=]@var{name},string=@var{str}
  2506. Add named fw_cfg entry with contents from string @var{str}.
  2507. The terminating NUL character of the contents of @var{str} will not be
  2508. included as part of the fw_cfg item data. To insert contents with
  2509. embedded NUL characters, you have to use the @var{file} parameter.
  2510. The fw_cfg entries are passed by QEMU through to the guest.
  2511. Example:
  2512. @example
  2513. -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin
  2514. @end example
  2515. creates an fw_cfg entry named opt/com.mycompany/blob with contents
  2516. from ./my_blob.bin.
  2517. ETEXI
  2518. DEF("serial", HAS_ARG, QEMU_OPTION_serial, \
  2519. "-serial dev redirect the serial port to char device 'dev'\n",
  2520. QEMU_ARCH_ALL)
  2521. STEXI
  2522. @item -serial @var{dev}
  2523. @findex -serial
  2524. Redirect the virtual serial port to host character device
  2525. @var{dev}. The default device is @code{vc} in graphical mode and
  2526. @code{stdio} in non graphical mode.
  2527. This option can be used several times to simulate up to 4 serial
  2528. ports.
  2529. Use @code{-serial none} to disable all serial ports.
  2530. Available character devices are:
  2531. @table @option
  2532. @item vc[:@var{W}x@var{H}]
  2533. Virtual console. Optionally, a width and height can be given in pixel with
  2534. @example
  2535. vc:800x600
  2536. @end example
  2537. It is also possible to specify width or height in characters:
  2538. @example
  2539. vc:80Cx24C
  2540. @end example
  2541. @item pty
  2542. [Linux only] Pseudo TTY (a new PTY is automatically allocated)
  2543. @item none
  2544. No device is allocated.
  2545. @item null
  2546. void device
  2547. @item chardev:@var{id}
  2548. Use a named character device defined with the @code{-chardev} option.
  2549. @item /dev/XXX
  2550. [Linux only] Use host tty, e.g. @file{/dev/ttyS0}. The host serial port
  2551. parameters are set according to the emulated ones.
  2552. @item /dev/parport@var{N}
  2553. [Linux only, parallel port only] Use host parallel port
  2554. @var{N}. Currently SPP and EPP parallel port features can be used.
  2555. @item file:@var{filename}
  2556. Write output to @var{filename}. No character can be read.
  2557. @item stdio
  2558. [Unix only] standard input/output
  2559. @item pipe:@var{filename}
  2560. name pipe @var{filename}
  2561. @item COM@var{n}
  2562. [Windows only] Use host serial port @var{n}
  2563. @item udp:[@var{remote_host}]:@var{remote_port}[@@[@var{src_ip}]:@var{src_port}]
  2564. This implements UDP Net Console.
  2565. When @var{remote_host} or @var{src_ip} are not specified
  2566. they default to @code{0.0.0.0}.
  2567. When not using a specified @var{src_port} a random port is automatically chosen.
  2568. If you just want a simple readonly console you can use @code{netcat} or
  2569. @code{nc}, by starting QEMU with: @code{-serial udp::4555} and nc as:
  2570. @code{nc -u -l -p 4555}. Any time QEMU writes something to that port it
  2571. will appear in the netconsole session.
  2572. If you plan to send characters back via netconsole or you want to stop
  2573. and start QEMU a lot of times, you should have QEMU use the same
  2574. source port each time by using something like @code{-serial
  2575. udp::4555@@:4556} to QEMU. Another approach is to use a patched
  2576. version of netcat which can listen to a TCP port and send and receive
  2577. characters via udp. If you have a patched version of netcat which
  2578. activates telnet remote echo and single char transfer, then you can
  2579. use the following options to set up a netcat redirector to allow
  2580. telnet on port 5555 to access the QEMU port.
  2581. @table @code
  2582. @item QEMU Options:
  2583. -serial udp::4555@@:4556
  2584. @item netcat options:
  2585. -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T
  2586. @item telnet options:
  2587. localhost 5555
  2588. @end table
  2589. @item tcp:[@var{host}]:@var{port}[,@var{server}][,nowait][,nodelay][,reconnect=@var{seconds}]
  2590. The TCP Net Console has two modes of operation. It can send the serial
  2591. I/O to a location or wait for a connection from a location. By default
  2592. the TCP Net Console is sent to @var{host} at the @var{port}. If you use
  2593. the @var{server} option QEMU will wait for a client socket application
  2594. to connect to the port before continuing, unless the @code{nowait}
  2595. option was specified. The @code{nodelay} option disables the Nagle buffering
  2596. algorithm. The @code{reconnect} option only applies if @var{noserver} is
  2597. set, if the connection goes down it will attempt to reconnect at the
  2598. given interval. If @var{host} is omitted, 0.0.0.0 is assumed. Only
  2599. one TCP connection at a time is accepted. You can use @code{telnet} to
  2600. connect to the corresponding character device.
  2601. @table @code
  2602. @item Example to send tcp console to 192.168.0.2 port 4444
  2603. -serial tcp:192.168.0.2:4444
  2604. @item Example to listen and wait on port 4444 for connection
  2605. -serial tcp::4444,server
  2606. @item Example to not wait and listen on ip 192.168.0.100 port 4444
  2607. -serial tcp:192.168.0.100:4444,server,nowait
  2608. @end table
  2609. @item telnet:@var{host}:@var{port}[,server][,nowait][,nodelay]
  2610. The telnet protocol is used instead of raw tcp sockets. The options
  2611. work the same as if you had specified @code{-serial tcp}. The
  2612. difference is that the port acts like a telnet server or client using
  2613. telnet option negotiation. This will also allow you to send the
  2614. MAGIC_SYSRQ sequence if you use a telnet that supports sending the break
  2615. sequence. Typically in unix telnet you do it with Control-] and then
  2616. type "send break" followed by pressing the enter key.
  2617. @item unix:@var{path}[,server][,nowait][,reconnect=@var{seconds}]
  2618. A unix domain socket is used instead of a tcp socket. The option works the
  2619. same as if you had specified @code{-serial tcp} except the unix domain socket
  2620. @var{path} is used for connections.
  2621. @item mon:@var{dev_string}
  2622. This is a special option to allow the monitor to be multiplexed onto
  2623. another serial port. The monitor is accessed with key sequence of
  2624. @key{Control-a} and then pressing @key{c}.
  2625. @var{dev_string} should be any one of the serial devices specified
  2626. above. An example to multiplex the monitor onto a telnet server
  2627. listening on port 4444 would be:
  2628. @table @code
  2629. @item -serial mon:telnet::4444,server,nowait
  2630. @end table
  2631. When the monitor is multiplexed to stdio in this way, Ctrl+C will not terminate
  2632. QEMU any more but will be passed to the guest instead.
  2633. @item braille
  2634. Braille device. This will use BrlAPI to display the braille output on a real
  2635. or fake device.
  2636. @item msmouse
  2637. Three button serial mouse. Configure the guest to use Microsoft protocol.
  2638. @end table
  2639. ETEXI
  2640. DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \
  2641. "-parallel dev redirect the parallel port to char device 'dev'\n",
  2642. QEMU_ARCH_ALL)
  2643. STEXI
  2644. @item -parallel @var{dev}
  2645. @findex -parallel
  2646. Redirect the virtual parallel port to host device @var{dev} (same
  2647. devices as the serial port). On Linux hosts, @file{/dev/parportN} can
  2648. be used to use hardware devices connected on the corresponding host
  2649. parallel port.
  2650. This option can be used several times to simulate up to 3 parallel
  2651. ports.
  2652. Use @code{-parallel none} to disable all parallel ports.
  2653. ETEXI
  2654. DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \
  2655. "-monitor dev redirect the monitor to char device 'dev'\n",
  2656. QEMU_ARCH_ALL)
  2657. STEXI
  2658. @item -monitor @var{dev}
  2659. @findex -monitor
  2660. Redirect the monitor to host device @var{dev} (same devices as the
  2661. serial port).
  2662. The default device is @code{vc} in graphical mode and @code{stdio} in
  2663. non graphical mode.
  2664. Use @code{-monitor none} to disable the default monitor.
  2665. ETEXI
  2666. DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
  2667. "-qmp dev like -monitor but opens in 'control' mode\n",
  2668. QEMU_ARCH_ALL)
  2669. STEXI
  2670. @item -qmp @var{dev}
  2671. @findex -qmp
  2672. Like -monitor but opens in 'control' mode.
  2673. ETEXI
  2674. DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \
  2675. "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n",
  2676. QEMU_ARCH_ALL)
  2677. STEXI
  2678. @item -qmp-pretty @var{dev}
  2679. @findex -qmp-pretty
  2680. Like -qmp but uses pretty JSON formatting.
  2681. ETEXI
  2682. DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
  2683. "-mon [chardev=]name[,mode=readline|control]\n", QEMU_ARCH_ALL)
  2684. STEXI
  2685. @item -mon [chardev=]name[,mode=readline|control]
  2686. @findex -mon
  2687. Setup monitor on chardev @var{name}.
  2688. ETEXI
  2689. DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \
  2690. "-debugcon dev redirect the debug console to char device 'dev'\n",
  2691. QEMU_ARCH_ALL)
  2692. STEXI
  2693. @item -debugcon @var{dev}
  2694. @findex -debugcon
  2695. Redirect the debug console to host device @var{dev} (same devices as the
  2696. serial port). The debug console is an I/O port which is typically port
  2697. 0xe9; writing to that I/O port sends output to this device.
  2698. The default device is @code{vc} in graphical mode and @code{stdio} in
  2699. non graphical mode.
  2700. ETEXI
  2701. DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \
  2702. "-pidfile file write PID to 'file'\n", QEMU_ARCH_ALL)
  2703. STEXI
  2704. @item -pidfile @var{file}
  2705. @findex -pidfile
  2706. Store the QEMU process PID in @var{file}. It is useful if you launch QEMU
  2707. from a script.
  2708. ETEXI
  2709. DEF("singlestep", 0, QEMU_OPTION_singlestep, \
  2710. "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL)
  2711. STEXI
  2712. @item -singlestep
  2713. @findex -singlestep
  2714. Run the emulation in single step mode.
  2715. ETEXI
  2716. DEF("S", 0, QEMU_OPTION_S, \
  2717. "-S freeze CPU at startup (use 'c' to start execution)\n",
  2718. QEMU_ARCH_ALL)
  2719. STEXI
  2720. @item -S
  2721. @findex -S
  2722. Do not start CPU at startup (you must type 'c' in the monitor).
  2723. ETEXI
  2724. DEF("realtime", HAS_ARG, QEMU_OPTION_realtime,
  2725. "-realtime [mlock=on|off]\n"
  2726. " run qemu with realtime features\n"
  2727. " mlock=on|off controls mlock support (default: on)\n",
  2728. QEMU_ARCH_ALL)
  2729. STEXI
  2730. @item -realtime mlock=on|off
  2731. @findex -realtime
  2732. Run qemu with realtime features.
  2733. mlocking qemu and guest memory can be enabled via @option{mlock=on}
  2734. (enabled by default).
  2735. ETEXI
  2736. DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \
  2737. "-gdb dev wait for gdb connection on 'dev'\n", QEMU_ARCH_ALL)
  2738. STEXI
  2739. @item -gdb @var{dev}
  2740. @findex -gdb
  2741. Wait for gdb connection on device @var{dev} (@pxref{gdb_usage}). Typical
  2742. connections will likely be TCP-based, but also UDP, pseudo TTY, or even
  2743. stdio are reasonable use case. The latter is allowing to start QEMU from
  2744. within gdb and establish the connection via a pipe:
  2745. @example
  2746. (gdb) target remote | exec qemu-system-i386 -gdb stdio ...
  2747. @end example
  2748. ETEXI
  2749. DEF("s", 0, QEMU_OPTION_s, \
  2750. "-s shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n",
  2751. QEMU_ARCH_ALL)
  2752. STEXI
  2753. @item -s
  2754. @findex -s
  2755. Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234
  2756. (@pxref{gdb_usage}).
  2757. ETEXI
  2758. DEF("d", HAS_ARG, QEMU_OPTION_d, \
  2759. "-d item1,... enable logging of specified items (use '-d help' for a list of log items)\n",
  2760. QEMU_ARCH_ALL)
  2761. STEXI
  2762. @item -d @var{item1}[,...]
  2763. @findex -d
  2764. Enable logging of specified items. Use '-d help' for a list of log items.
  2765. ETEXI
  2766. DEF("D", HAS_ARG, QEMU_OPTION_D, \
  2767. "-D logfile output log to logfile (default stderr)\n",
  2768. QEMU_ARCH_ALL)
  2769. STEXI
  2770. @item -D @var{logfile}
  2771. @findex -D
  2772. Output log in @var{logfile} instead of to stderr
  2773. ETEXI
  2774. DEF("dfilter", HAS_ARG, QEMU_OPTION_DFILTER, \
  2775. "-dfilter range,.. filter debug output to range of addresses (useful for -d cpu,exec,etc..)\n",
  2776. QEMU_ARCH_ALL)
  2777. STEXI
  2778. @item -dfilter @var{range1}[,...]
  2779. @findex -dfilter
  2780. Filter debug output to that relevant to a range of target addresses. The filter
  2781. spec can be either @var{start}+@var{size}, @var{start}-@var{size} or
  2782. @var{start}..@var{end} where @var{start} @var{end} and @var{size} are the
  2783. addresses and sizes required. For example:
  2784. @example
  2785. -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000
  2786. @end example
  2787. Will dump output for any code in the 0x1000 sized block starting at 0x8000 and
  2788. the 0x200 sized block starting at 0xffffffc000080000 and another 0x1000 sized
  2789. block starting at 0xffffffc00005f000.
  2790. ETEXI
  2791. DEF("L", HAS_ARG, QEMU_OPTION_L, \
  2792. "-L path set the directory for the BIOS, VGA BIOS and keymaps\n",
  2793. QEMU_ARCH_ALL)
  2794. STEXI
  2795. @item -L @var{path}
  2796. @findex -L
  2797. Set the directory for the BIOS, VGA BIOS and keymaps.
  2798. To list all the data directories, use @code{-L help}.
  2799. ETEXI
  2800. DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
  2801. "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL)
  2802. STEXI
  2803. @item -bios @var{file}
  2804. @findex -bios
  2805. Set the filename for the BIOS.
  2806. ETEXI
  2807. DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
  2808. "-enable-kvm enable KVM full virtualization support\n", QEMU_ARCH_ALL)
  2809. STEXI
  2810. @item -enable-kvm
  2811. @findex -enable-kvm
  2812. Enable KVM full virtualization support. This option is only available
  2813. if KVM support is enabled when compiling.
  2814. ETEXI
  2815. DEF("enable-hax", 0, QEMU_OPTION_enable_hax, \
  2816. "-enable-hax enable HAX virtualization support\n", QEMU_ARCH_I386)
  2817. STEXI
  2818. @item -enable-hax
  2819. @findex -enable-hax
  2820. Enable HAX (Hardware-based Acceleration eXecution) support. This option
  2821. is only available if HAX support is enabled when compiling. HAX is only
  2822. applicable to MAC and Windows platform, and thus does not conflict with
  2823. KVM.
  2824. ETEXI
  2825. DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid,
  2826. "-xen-domid id specify xen guest domain id\n", QEMU_ARCH_ALL)
  2827. DEF("xen-create", 0, QEMU_OPTION_xen_create,
  2828. "-xen-create create domain using xen hypercalls, bypassing xend\n"
  2829. " warning: should not be used when xend is in use\n",
  2830. QEMU_ARCH_ALL)
  2831. DEF("xen-attach", 0, QEMU_OPTION_xen_attach,
  2832. "-xen-attach attach to existing xen domain\n"
  2833. " xend will use this when starting QEMU\n",
  2834. QEMU_ARCH_ALL)
  2835. STEXI
  2836. @item -xen-domid @var{id}
  2837. @findex -xen-domid
  2838. Specify xen guest domain @var{id} (XEN only).
  2839. @item -xen-create
  2840. @findex -xen-create
  2841. Create domain using xen hypercalls, bypassing xend.
  2842. Warning: should not be used when xend is in use (XEN only).
  2843. @item -xen-attach
  2844. @findex -xen-attach
  2845. Attach to existing xen domain.
  2846. xend will use this when starting QEMU (XEN only).
  2847. ETEXI
  2848. DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \
  2849. "-no-reboot exit instead of rebooting\n", QEMU_ARCH_ALL)
  2850. STEXI
  2851. @item -no-reboot
  2852. @findex -no-reboot
  2853. Exit instead of rebooting.
  2854. ETEXI
  2855. DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \
  2856. "-no-shutdown stop before shutdown\n", QEMU_ARCH_ALL)
  2857. STEXI
  2858. @item -no-shutdown
  2859. @findex -no-shutdown
  2860. Don't exit QEMU on guest shutdown, but instead only stop the emulation.
  2861. This allows for instance switching to monitor to commit changes to the
  2862. disk image.
  2863. ETEXI
  2864. DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \
  2865. "-loadvm [tag|id]\n" \
  2866. " start right away with a saved state (loadvm in monitor)\n",
  2867. QEMU_ARCH_ALL)
  2868. STEXI
  2869. @item -loadvm @var{file}
  2870. @findex -loadvm
  2871. Start right away with a saved state (@code{loadvm} in monitor)
  2872. ETEXI
  2873. #ifndef _WIN32
  2874. DEF("daemonize", 0, QEMU_OPTION_daemonize, \
  2875. "-daemonize daemonize QEMU after initializing\n", QEMU_ARCH_ALL)
  2876. #endif
  2877. STEXI
  2878. @item -daemonize
  2879. @findex -daemonize
  2880. Daemonize the QEMU process after initialization. QEMU will not detach from
  2881. standard IO until it is ready to receive connections on any of its devices.
  2882. This option is a useful way for external programs to launch QEMU without having
  2883. to cope with initialization race conditions.
  2884. ETEXI
  2885. DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \
  2886. "-option-rom rom load a file, rom, into the option ROM space\n",
  2887. QEMU_ARCH_ALL)
  2888. STEXI
  2889. @item -option-rom @var{file}
  2890. @findex -option-rom
  2891. Load the contents of @var{file} as an option ROM.
  2892. This option is useful to load things like EtherBoot.
  2893. ETEXI
  2894. HXCOMM Silently ignored for compatibility
  2895. DEF("clock", HAS_ARG, QEMU_OPTION_clock, "", QEMU_ARCH_ALL)
  2896. HXCOMM Options deprecated by -rtc
  2897. DEF("localtime", 0, QEMU_OPTION_localtime, "", QEMU_ARCH_ALL)
  2898. DEF("startdate", HAS_ARG, QEMU_OPTION_startdate, "", QEMU_ARCH_ALL)
  2899. DEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \
  2900. "-rtc [base=utc|localtime|date][,clock=host|rt|vm][,driftfix=none|slew]\n" \
  2901. " set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n",
  2902. QEMU_ARCH_ALL)
  2903. STEXI
  2904. @item -rtc [base=utc|localtime|@var{date}][,clock=host|vm][,driftfix=none|slew]
  2905. @findex -rtc
  2906. Specify @option{base} as @code{utc} or @code{localtime} to let the RTC start at the current
  2907. UTC or local time, respectively. @code{localtime} is required for correct date in
  2908. MS-DOS or Windows. To start at a specific point in time, provide @var{date} in the
  2909. format @code{2006-06-17T16:01:21} or @code{2006-06-17}. The default base is UTC.
  2910. By default the RTC is driven by the host system time. This allows using of the
  2911. RTC as accurate reference clock inside the guest, specifically if the host
  2912. time is smoothly following an accurate external reference clock, e.g. via NTP.
  2913. If you want to isolate the guest time from the host, you can set @option{clock}
  2914. to @code{rt} instead. To even prevent it from progressing during suspension,
  2915. you can set it to @code{vm}.
  2916. Enable @option{driftfix} (i386 targets only) if you experience time drift problems,
  2917. specifically with Windows' ACPI HAL. This option will try to figure out how
  2918. many timer interrupts were not processed by the Windows guest and will
  2919. re-inject them.
  2920. ETEXI
  2921. DEF("icount", HAS_ARG, QEMU_OPTION_icount, \
  2922. "-icount [shift=N|auto][,align=on|off][,sleep=on|off,rr=record|replay,rrfile=<filename>,rrsnapshot=<snapshot>]\n" \
  2923. " enable virtual instruction counter with 2^N clock ticks per\n" \
  2924. " instruction, enable aligning the host and virtual clocks\n" \
  2925. " or disable real time cpu sleeping\n", QEMU_ARCH_ALL)
  2926. STEXI
  2927. @item -icount [shift=@var{N}|auto][,rr=record|replay,rrfile=@var{filename},rrsnapshot=@var{snapshot}]
  2928. @findex -icount
  2929. Enable virtual instruction counter. The virtual cpu will execute one
  2930. instruction every 2^@var{N} ns of virtual time. If @code{auto} is specified
  2931. then the virtual cpu speed will be automatically adjusted to keep virtual
  2932. time within a few seconds of real time.
  2933. When the virtual cpu is sleeping, the virtual time will advance at default
  2934. speed unless @option{sleep=on|off} is specified.
  2935. With @option{sleep=on|off}, the virtual time will jump to the next timer deadline
  2936. instantly whenever the virtual cpu goes to sleep mode and will not advance
  2937. if no timer is enabled. This behavior give deterministic execution times from
  2938. the guest point of view.
  2939. Note that while this option can give deterministic behavior, it does not
  2940. provide cycle accurate emulation. Modern CPUs contain superscalar out of
  2941. order cores with complex cache hierarchies. The number of instructions
  2942. executed often has little or no correlation with actual performance.
  2943. @option{align=on} will activate the delay algorithm which will try
  2944. to synchronise the host clock and the virtual clock. The goal is to
  2945. have a guest running at the real frequency imposed by the shift option.
  2946. Whenever the guest clock is behind the host clock and if
  2947. @option{align=on} is specified then we print a message to the user
  2948. to inform about the delay.
  2949. Currently this option does not work when @option{shift} is @code{auto}.
  2950. Note: The sync algorithm will work for those shift values for which
  2951. the guest clock runs ahead of the host clock. Typically this happens
  2952. when the shift value is high (how high depends on the host machine).
  2953. When @option{rr} option is specified deterministic record/replay is enabled.
  2954. Replay log is written into @var{filename} file in record mode and
  2955. read from this file in replay mode.
  2956. Option rrsnapshot is used to create new vm snapshot named @var{snapshot}
  2957. at the start of execution recording. In replay mode this option is used
  2958. to load the initial VM state.
  2959. ETEXI
  2960. DEF("watchdog", HAS_ARG, QEMU_OPTION_watchdog, \
  2961. "-watchdog model\n" \
  2962. " enable virtual hardware watchdog [default=none]\n",
  2963. QEMU_ARCH_ALL)
  2964. STEXI
  2965. @item -watchdog @var{model}
  2966. @findex -watchdog
  2967. Create a virtual hardware watchdog device. Once enabled (by a guest
  2968. action), the watchdog must be periodically polled by an agent inside
  2969. the guest or else the guest will be restarted. Choose a model for
  2970. which your guest has drivers.
  2971. The @var{model} is the model of hardware watchdog to emulate. Use
  2972. @code{-watchdog help} to list available hardware models. Only one
  2973. watchdog can be enabled for a guest.
  2974. The following models may be available:
  2975. @table @option
  2976. @item ib700
  2977. iBASE 700 is a very simple ISA watchdog with a single timer.
  2978. @item i6300esb
  2979. Intel 6300ESB I/O controller hub is a much more featureful PCI-based
  2980. dual-timer watchdog.
  2981. @item diag288
  2982. A virtual watchdog for s390x backed by the diagnose 288 hypercall
  2983. (currently KVM only).
  2984. @end table
  2985. ETEXI
  2986. DEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \
  2987. "-watchdog-action reset|shutdown|poweroff|pause|debug|none\n" \
  2988. " action when watchdog fires [default=reset]\n",
  2989. QEMU_ARCH_ALL)
  2990. STEXI
  2991. @item -watchdog-action @var{action}
  2992. @findex -watchdog-action
  2993. The @var{action} controls what QEMU will do when the watchdog timer
  2994. expires.
  2995. The default is
  2996. @code{reset} (forcefully reset the guest).
  2997. Other possible actions are:
  2998. @code{shutdown} (attempt to gracefully shutdown the guest),
  2999. @code{poweroff} (forcefully poweroff the guest),
  3000. @code{pause} (pause the guest),
  3001. @code{debug} (print a debug message and continue), or
  3002. @code{none} (do nothing).
  3003. Note that the @code{shutdown} action requires that the guest responds
  3004. to ACPI signals, which it may not be able to do in the sort of
  3005. situations where the watchdog would have expired, and thus
  3006. @code{-watchdog-action shutdown} is not recommended for production use.
  3007. Examples:
  3008. @table @code
  3009. @item -watchdog i6300esb -watchdog-action pause
  3010. @itemx -watchdog ib700
  3011. @end table
  3012. ETEXI
  3013. DEF("echr", HAS_ARG, QEMU_OPTION_echr, \
  3014. "-echr chr set terminal escape character instead of ctrl-a\n",
  3015. QEMU_ARCH_ALL)
  3016. STEXI
  3017. @item -echr @var{numeric_ascii_value}
  3018. @findex -echr
  3019. Change the escape character used for switching to the monitor when using
  3020. monitor and serial sharing. The default is @code{0x01} when using the
  3021. @code{-nographic} option. @code{0x01} is equal to pressing
  3022. @code{Control-a}. You can select a different character from the ascii
  3023. control keys where 1 through 26 map to Control-a through Control-z. For
  3024. instance you could use the either of the following to change the escape
  3025. character to Control-t.
  3026. @table @code
  3027. @item -echr 0x14
  3028. @itemx -echr 20
  3029. @end table
  3030. ETEXI
  3031. DEF("virtioconsole", HAS_ARG, QEMU_OPTION_virtiocon, \
  3032. "-virtioconsole c\n" \
  3033. " set virtio console\n", QEMU_ARCH_ALL)
  3034. STEXI
  3035. @item -virtioconsole @var{c}
  3036. @findex -virtioconsole
  3037. Set virtio console.
  3038. This option is maintained for backward compatibility.
  3039. Please use @code{-device virtconsole} for the new way of invocation.
  3040. ETEXI
  3041. DEF("show-cursor", 0, QEMU_OPTION_show_cursor, \
  3042. "-show-cursor show cursor\n", QEMU_ARCH_ALL)
  3043. STEXI
  3044. @item -show-cursor
  3045. @findex -show-cursor
  3046. Show cursor.
  3047. ETEXI
  3048. DEF("tb-size", HAS_ARG, QEMU_OPTION_tb_size, \
  3049. "-tb-size n set TB size\n", QEMU_ARCH_ALL)
  3050. STEXI
  3051. @item -tb-size @var{n}
  3052. @findex -tb-size
  3053. Set TB size.
  3054. ETEXI
  3055. DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \
  3056. "-incoming tcp:[host]:port[,to=maxport][,ipv4][,ipv6]\n" \
  3057. "-incoming rdma:host:port[,ipv4][,ipv6]\n" \
  3058. "-incoming unix:socketpath\n" \
  3059. " prepare for incoming migration, listen on\n" \
  3060. " specified protocol and socket address\n" \
  3061. "-incoming fd:fd\n" \
  3062. "-incoming exec:cmdline\n" \
  3063. " accept incoming migration on given file descriptor\n" \
  3064. " or from given external command\n" \
  3065. "-incoming defer\n" \
  3066. " wait for the URI to be specified via migrate_incoming\n",
  3067. QEMU_ARCH_ALL)
  3068. STEXI
  3069. @item -incoming tcp:[@var{host}]:@var{port}[,to=@var{maxport}][,ipv4][,ipv6]
  3070. @itemx -incoming rdma:@var{host}:@var{port}[,ipv4][,ipv6]
  3071. @findex -incoming
  3072. Prepare for incoming migration, listen on a given tcp port.
  3073. @item -incoming unix:@var{socketpath}
  3074. Prepare for incoming migration, listen on a given unix socket.
  3075. @item -incoming fd:@var{fd}
  3076. Accept incoming migration from a given filedescriptor.
  3077. @item -incoming exec:@var{cmdline}
  3078. Accept incoming migration as an output from specified external command.
  3079. @item -incoming defer
  3080. Wait for the URI to be specified via migrate_incoming. The monitor can
  3081. be used to change settings (such as migration parameters) prior to issuing
  3082. the migrate_incoming to allow the migration to begin.
  3083. ETEXI
  3084. DEF("only-migratable", 0, QEMU_OPTION_only_migratable, \
  3085. "-only-migratable allow only migratable devices\n", QEMU_ARCH_ALL)
  3086. STEXI
  3087. @item -only-migratable
  3088. @findex -only-migratable
  3089. Only allow migratable devices. Devices will not be allowed to enter an
  3090. unmigratable state.
  3091. ETEXI
  3092. DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \
  3093. "-nodefaults don't create default devices\n", QEMU_ARCH_ALL)
  3094. STEXI
  3095. @item -nodefaults
  3096. @findex -nodefaults
  3097. Don't create default devices. Normally, QEMU sets the default devices like serial
  3098. port, parallel port, virtual console, monitor device, VGA adapter, floppy and
  3099. CD-ROM drive and others. The @code{-nodefaults} option will disable all those
  3100. default devices.
  3101. ETEXI
  3102. #ifndef _WIN32
  3103. DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \
  3104. "-chroot dir chroot to dir just before starting the VM\n",
  3105. QEMU_ARCH_ALL)
  3106. #endif
  3107. STEXI
  3108. @item -chroot @var{dir}
  3109. @findex -chroot
  3110. Immediately before starting guest execution, chroot to the specified
  3111. directory. Especially useful in combination with -runas.
  3112. ETEXI
  3113. #ifndef _WIN32
  3114. DEF("runas", HAS_ARG, QEMU_OPTION_runas, \
  3115. "-runas user change to user id user just before starting the VM\n",
  3116. QEMU_ARCH_ALL)
  3117. #endif
  3118. STEXI
  3119. @item -runas @var{user}
  3120. @findex -runas
  3121. Immediately before starting guest execution, drop root privileges, switching
  3122. to the specified user.
  3123. ETEXI
  3124. DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env,
  3125. "-prom-env variable=value\n"
  3126. " set OpenBIOS nvram variables\n",
  3127. QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
  3128. STEXI
  3129. @item -prom-env @var{variable}=@var{value}
  3130. @findex -prom-env
  3131. Set OpenBIOS nvram @var{variable} to given @var{value} (PPC, SPARC only).
  3132. ETEXI
  3133. DEF("semihosting", 0, QEMU_OPTION_semihosting,
  3134. "-semihosting semihosting mode\n",
  3135. QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
  3136. QEMU_ARCH_MIPS)
  3137. STEXI
  3138. @item -semihosting
  3139. @findex -semihosting
  3140. Enable semihosting mode (ARM, M68K, Xtensa, MIPS only).
  3141. ETEXI
  3142. DEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config,
  3143. "-semihosting-config [enable=on|off][,target=native|gdb|auto][,arg=str[,...]]\n" \
  3144. " semihosting configuration\n",
  3145. QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
  3146. QEMU_ARCH_MIPS)
  3147. STEXI
  3148. @item -semihosting-config [enable=on|off][,target=native|gdb|auto][,arg=str[,...]]
  3149. @findex -semihosting-config
  3150. Enable and configure semihosting (ARM, M68K, Xtensa, MIPS only).
  3151. @table @option
  3152. @item target=@code{native|gdb|auto}
  3153. Defines where the semihosting calls will be addressed, to QEMU (@code{native})
  3154. or to GDB (@code{gdb}). The default is @code{auto}, which means @code{gdb}
  3155. during debug sessions and @code{native} otherwise.
  3156. @item arg=@var{str1},arg=@var{str2},...
  3157. Allows the user to pass input arguments, and can be used multiple times to build
  3158. up a list. The old-style @code{-kernel}/@code{-append} method of passing a
  3159. command line is still supported for backward compatibility. If both the
  3160. @code{--semihosting-config arg} and the @code{-kernel}/@code{-append} are
  3161. specified, the former is passed to semihosting as it always takes precedence.
  3162. @end table
  3163. ETEXI
  3164. DEF("old-param", 0, QEMU_OPTION_old_param,
  3165. "-old-param old param mode\n", QEMU_ARCH_ARM)
  3166. STEXI
  3167. @item -old-param
  3168. @findex -old-param (ARM)
  3169. Old param mode (ARM only).
  3170. ETEXI
  3171. DEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \
  3172. "-sandbox <arg> Enable seccomp mode 2 system call filter (default 'off').\n",
  3173. QEMU_ARCH_ALL)
  3174. STEXI
  3175. @item -sandbox @var{arg}
  3176. @findex -sandbox
  3177. Enable Seccomp mode 2 system call filter. 'on' will enable syscall filtering and 'off' will
  3178. disable it. The default is 'off'.
  3179. ETEXI
  3180. DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
  3181. "-readconfig <file>\n", QEMU_ARCH_ALL)
  3182. STEXI
  3183. @item -readconfig @var{file}
  3184. @findex -readconfig
  3185. Read device configuration from @var{file}. This approach is useful when you want to spawn
  3186. QEMU process with many command line options but you don't want to exceed the command line
  3187. character limit.
  3188. ETEXI
  3189. DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
  3190. "-writeconfig <file>\n"
  3191. " read/write config file\n", QEMU_ARCH_ALL)
  3192. STEXI
  3193. @item -writeconfig @var{file}
  3194. @findex -writeconfig
  3195. Write device configuration to @var{file}. The @var{file} can be either filename to save
  3196. command line and device configuration into file or dash @code{-}) character to print the
  3197. output to stdout. This can be later used as input file for @code{-readconfig} option.
  3198. ETEXI
  3199. DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig,
  3200. "-nodefconfig\n"
  3201. " do not load default config files at startup\n",
  3202. QEMU_ARCH_ALL)
  3203. STEXI
  3204. @item -nodefconfig
  3205. @findex -nodefconfig
  3206. Normally QEMU loads configuration files from @var{sysconfdir} and @var{datadir} at startup.
  3207. The @code{-nodefconfig} option will prevent QEMU from loading any of those config files.
  3208. ETEXI
  3209. DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
  3210. "-no-user-config\n"
  3211. " do not load user-provided config files at startup\n",
  3212. QEMU_ARCH_ALL)
  3213. STEXI
  3214. @item -no-user-config
  3215. @findex -no-user-config
  3216. The @code{-no-user-config} option makes QEMU not load any of the user-provided
  3217. config files on @var{sysconfdir}, but won't make it skip the QEMU-provided config
  3218. files from @var{datadir}.
  3219. ETEXI
  3220. DEF("trace", HAS_ARG, QEMU_OPTION_trace,
  3221. "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
  3222. " specify tracing options\n",
  3223. QEMU_ARCH_ALL)
  3224. STEXI
  3225. HXCOMM This line is not accurate, as some sub-options are backend-specific but
  3226. HXCOMM HX does not support conditional compilation of text.
  3227. @item -trace [[enable=]@var{pattern}][,events=@var{file}][,file=@var{file}]
  3228. @findex -trace
  3229. @include qemu-option-trace.texi
  3230. ETEXI
  3231. HXCOMM Internal use
  3232. DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL)
  3233. DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL)
  3234. #ifdef __linux__
  3235. DEF("enable-fips", 0, QEMU_OPTION_enablefips,
  3236. "-enable-fips enable FIPS 140-2 compliance\n",
  3237. QEMU_ARCH_ALL)
  3238. #endif
  3239. STEXI
  3240. @item -enable-fips
  3241. @findex -enable-fips
  3242. Enable FIPS 140-2 compliance mode.
  3243. ETEXI
  3244. HXCOMM Deprecated by -machine accel=tcg property
  3245. DEF("no-kvm", 0, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386)
  3246. HXCOMM Deprecated by kvm-pit driver properties
  3247. DEF("no-kvm-pit-reinjection", 0, QEMU_OPTION_no_kvm_pit_reinjection,
  3248. "", QEMU_ARCH_I386)
  3249. HXCOMM Deprecated (ignored)
  3250. DEF("no-kvm-pit", 0, QEMU_OPTION_no_kvm_pit, "", QEMU_ARCH_I386)
  3251. HXCOMM Deprecated by -machine kernel_irqchip=on|off property
  3252. DEF("no-kvm-irqchip", 0, QEMU_OPTION_no_kvm_irqchip, "", QEMU_ARCH_I386)
  3253. HXCOMM Deprecated (ignored)
  3254. DEF("tdf", 0, QEMU_OPTION_tdf,"", QEMU_ARCH_ALL)
  3255. DEF("msg", HAS_ARG, QEMU_OPTION_msg,
  3256. "-msg timestamp[=on|off]\n"
  3257. " change the format of messages\n"
  3258. " on|off controls leading timestamps (default:on)\n",
  3259. QEMU_ARCH_ALL)
  3260. STEXI
  3261. @item -msg timestamp[=on|off]
  3262. @findex -msg
  3263. prepend a timestamp to each log message.(default:on)
  3264. ETEXI
  3265. DEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate,
  3266. "-dump-vmstate <file>\n"
  3267. " Output vmstate information in JSON format to file.\n"
  3268. " Use the scripts/vmstate-static-checker.py file to\n"
  3269. " check for possible regressions in migration code\n"
  3270. " by comparing two such vmstate dumps.\n",
  3271. QEMU_ARCH_ALL)
  3272. STEXI
  3273. @item -dump-vmstate @var{file}
  3274. @findex -dump-vmstate
  3275. Dump json-encoded vmstate information for current machine type to file
  3276. in @var{file}
  3277. ETEXI
  3278. STEXI
  3279. @end table
  3280. ETEXI
  3281. DEFHEADING()
  3282. DEFHEADING(Generic object creation)
  3283. STEXI
  3284. @table @option
  3285. ETEXI
  3286. DEF("object", HAS_ARG, QEMU_OPTION_object,
  3287. "-object TYPENAME[,PROP1=VALUE1,...]\n"
  3288. " create a new object of type TYPENAME setting properties\n"
  3289. " in the order they are specified. Note that the 'id'\n"
  3290. " property must be set. These objects are placed in the\n"
  3291. " '/objects' path.\n",
  3292. QEMU_ARCH_ALL)
  3293. STEXI
  3294. @item -object @var{typename}[,@var{prop1}=@var{value1},...]
  3295. @findex -object
  3296. Create a new object of type @var{typename} setting properties
  3297. in the order they are specified. Note that the 'id'
  3298. property must be set. These objects are placed in the
  3299. '/objects' path.
  3300. @table @option
  3301. @item -object memory-backend-file,id=@var{id},size=@var{size},mem-path=@var{dir},share=@var{on|off}
  3302. Creates a memory file backend object, which can be used to back
  3303. the guest RAM with huge pages. The @option{id} parameter is a
  3304. unique ID that will be used to reference this memory region
  3305. when configuring the @option{-numa} argument. The @option{size}
  3306. option provides the size of the memory region, and accepts
  3307. common suffixes, eg @option{500M}. The @option{mem-path} provides
  3308. the path to either a shared memory or huge page filesystem mount.
  3309. The @option{share} boolean option determines whether the memory
  3310. region is marked as private to QEMU, or shared. The latter allows
  3311. a co-operating external process to access the QEMU memory region.
  3312. @item -object rng-random,id=@var{id},filename=@var{/dev/random}
  3313. Creates a random number generator backend which obtains entropy from
  3314. a device on the host. The @option{id} parameter is a unique ID that
  3315. will be used to reference this entropy backend from the @option{virtio-rng}
  3316. device. The @option{filename} parameter specifies which file to obtain
  3317. entropy from and if omitted defaults to @option{/dev/random}.
  3318. @item -object rng-egd,id=@var{id},chardev=@var{chardevid}
  3319. Creates a random number generator backend which obtains entropy from
  3320. an external daemon running on the host. The @option{id} parameter is
  3321. a unique ID that will be used to reference this entropy backend from
  3322. the @option{virtio-rng} device. The @option{chardev} parameter is
  3323. the unique ID of a character device backend that provides the connection
  3324. to the RNG daemon.
  3325. @item -object tls-creds-anon,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/cred/dir},verify-peer=@var{on|off}
  3326. Creates a TLS anonymous credentials object, which can be used to provide
  3327. TLS support on network backends. The @option{id} parameter is a unique
  3328. ID which network backends will use to access the credentials. The
  3329. @option{endpoint} is either @option{server} or @option{client} depending
  3330. on whether the QEMU network backend that uses the credentials will be
  3331. acting as a client or as a server. If @option{verify-peer} is enabled
  3332. (the default) then once the handshake is completed, the peer credentials
  3333. will be verified, though this is a no-op for anonymous credentials.
  3334. The @var{dir} parameter tells QEMU where to find the credential
  3335. files. For server endpoints, this directory may contain a file
  3336. @var{dh-params.pem} providing diffie-hellman parameters to use
  3337. for the TLS server. If the file is missing, QEMU will generate
  3338. a set of DH parameters at startup. This is a computationally
  3339. expensive operation that consumes random pool entropy, so it is
  3340. recommended that a persistent set of parameters be generated
  3341. upfront and saved.
  3342. @item -object tls-creds-x509,id=@var{id},endpoint=@var{endpoint},dir=@var{/path/to/cred/dir},verify-peer=@var{on|off},passwordid=@var{id}
  3343. Creates a TLS anonymous credentials object, which can be used to provide
  3344. TLS support on network backends. The @option{id} parameter is a unique
  3345. ID which network backends will use to access the credentials. The
  3346. @option{endpoint} is either @option{server} or @option{client} depending
  3347. on whether the QEMU network backend that uses the credentials will be
  3348. acting as a client or as a server. If @option{verify-peer} is enabled
  3349. (the default) then once the handshake is completed, the peer credentials
  3350. will be verified. With x509 certificates, this implies that the clients
  3351. must be provided with valid client certificates too.
  3352. The @var{dir} parameter tells QEMU where to find the credential
  3353. files. For server endpoints, this directory may contain a file
  3354. @var{dh-params.pem} providing diffie-hellman parameters to use
  3355. for the TLS server. If the file is missing, QEMU will generate
  3356. a set of DH parameters at startup. This is a computationally
  3357. expensive operation that consumes random pool entropy, so it is
  3358. recommended that a persistent set of parameters be generated
  3359. upfront and saved.
  3360. For x509 certificate credentials the directory will contain further files
  3361. providing the x509 certificates. The certificates must be stored
  3362. in PEM format, in filenames @var{ca-cert.pem}, @var{ca-crl.pem} (optional),
  3363. @var{server-cert.pem} (only servers), @var{server-key.pem} (only servers),
  3364. @var{client-cert.pem} (only clients), and @var{client-key.pem} (only clients).
  3365. For the @var{server-key.pem} and @var{client-key.pem} files which
  3366. contain sensitive private keys, it is possible to use an encrypted
  3367. version by providing the @var{passwordid} parameter. This provides
  3368. the ID of a previously created @code{secret} object containing the
  3369. password for decryption.
  3370. @item -object filter-buffer,id=@var{id},netdev=@var{netdevid},interval=@var{t}[,queue=@var{all|rx|tx}][,status=@var{on|off}]
  3371. Interval @var{t} can't be 0, this filter batches the packet delivery: all
  3372. packets arriving in a given interval on netdev @var{netdevid} are delayed
  3373. until the end of the interval. Interval is in microseconds.
  3374. @option{status} is optional that indicate whether the netfilter is
  3375. on (enabled) or off (disabled), the default status for netfilter will be 'on'.
  3376. queue @var{all|rx|tx} is an option that can be applied to any netfilter.
  3377. @option{all}: the filter is attached both to the receive and the transmit
  3378. queue of the netdev (default).
  3379. @option{rx}: the filter is attached to the receive queue of the netdev,
  3380. where it will receive packets sent to the netdev.
  3381. @option{tx}: the filter is attached to the transmit queue of the netdev,
  3382. where it will receive packets sent by the netdev.
  3383. @item -object filter-mirror,id=@var{id},netdev=@var{netdevid},outdev=@var{chardevid}[,queue=@var{all|rx|tx}]
  3384. filter-mirror on netdev @var{netdevid},mirror net packet to chardev
  3385. @var{chardevid}
  3386. @item -object filter-redirector,id=@var{id},netdev=@var{netdevid},indev=@var{chardevid},
  3387. outdev=@var{chardevid}[,queue=@var{all|rx|tx}]
  3388. filter-redirector on netdev @var{netdevid},redirect filter's net packet to chardev
  3389. @var{chardevid},and redirect indev's packet to filter.
  3390. Create a filter-redirector we need to differ outdev id from indev id, id can not
  3391. be the same. we can just use indev or outdev, but at least one of indev or outdev
  3392. need to be specified.
  3393. @item -object filter-rewriter,id=@var{id},netdev=@var{netdevid},rewriter-mode=@var{mode}[,queue=@var{all|rx|tx}]
  3394. Filter-rewriter is a part of COLO project.It will rewrite tcp packet to
  3395. secondary from primary to keep secondary tcp connection,and rewrite
  3396. tcp packet to primary from secondary make tcp packet can be handled by
  3397. client.
  3398. usage:
  3399. colo secondary:
  3400. -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
  3401. -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
  3402. -object filter-rewriter,id=rew0,netdev=hn0,queue=all
  3403. @item -object filter-dump,id=@var{id},netdev=@var{dev}[,file=@var{filename}][,maxlen=@var{len}]
  3404. Dump the network traffic on netdev @var{dev} to the file specified by
  3405. @var{filename}. At most @var{len} bytes (64k by default) per packet are stored.
  3406. The file format is libpcap, so it can be analyzed with tools such as tcpdump
  3407. or Wireshark.
  3408. @item -object colo-compare,id=@var{id},primary_in=@var{chardevid},secondary_in=@var{chardevid},
  3409. outdev=@var{chardevid}
  3410. Colo-compare gets packet from primary_in@var{chardevid} and secondary_in@var{chardevid}, than compare primary packet with
  3411. secondary packet. If the packets are same, we will output primary
  3412. packet to outdev@var{chardevid}, else we will notify colo-frame
  3413. do checkpoint and send primary packet to outdev@var{chardevid}.
  3414. we must use it with the help of filter-mirror and filter-redirector.
  3415. @example
  3416. primary:
  3417. -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
  3418. -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
  3419. -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
  3420. -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
  3421. -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
  3422. -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
  3423. -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
  3424. -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
  3425. -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
  3426. -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
  3427. -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
  3428. -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0
  3429. secondary:
  3430. -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
  3431. -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
  3432. -chardev socket,id=red0,host=3.3.3.3,port=9003
  3433. -chardev socket,id=red1,host=3.3.3.3,port=9004
  3434. -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
  3435. -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
  3436. @end example
  3437. If you want to know the detail of above command line, you can read
  3438. the colo-compare git log.
  3439. @item -object cryptodev-backend-builtin,id=@var{id}[,queues=@var{queues}]
  3440. Creates a cryptodev backend which executes crypto opreation from
  3441. the QEMU cipher APIS. The @var{id} parameter is
  3442. a unique ID that will be used to reference this cryptodev backend from
  3443. the @option{virtio-crypto} device. The @var{queues} parameter is optional,
  3444. which specify the queue number of cryptodev backend, the default of
  3445. @var{queues} is 1.
  3446. @example
  3447. # qemu-system-x86_64 \
  3448. [...] \
  3449. -object cryptodev-backend-builtin,id=cryptodev0 \
  3450. -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
  3451. [...]
  3452. @end example
  3453. @item -object secret,id=@var{id},data=@var{string},format=@var{raw|base64}[,keyid=@var{secretid},iv=@var{string}]
  3454. @item -object secret,id=@var{id},file=@var{filename},format=@var{raw|base64}[,keyid=@var{secretid},iv=@var{string}]
  3455. Defines a secret to store a password, encryption key, or some other sensitive
  3456. data. The sensitive data can either be passed directly via the @var{data}
  3457. parameter, or indirectly via the @var{file} parameter. Using the @var{data}
  3458. parameter is insecure unless the sensitive data is encrypted.
  3459. The sensitive data can be provided in raw format (the default), or base64.
  3460. When encoded as JSON, the raw format only supports valid UTF-8 characters,
  3461. so base64 is recommended for sending binary data. QEMU will convert from
  3462. which ever format is provided to the format it needs internally. eg, an
  3463. RBD password can be provided in raw format, even though it will be base64
  3464. encoded when passed onto the RBD sever.
  3465. For added protection, it is possible to encrypt the data associated with
  3466. a secret using the AES-256-CBC cipher. Use of encryption is indicated
  3467. by providing the @var{keyid} and @var{iv} parameters. The @var{keyid}
  3468. parameter provides the ID of a previously defined secret that contains
  3469. the AES-256 decryption key. This key should be 32-bytes long and be
  3470. base64 encoded. The @var{iv} parameter provides the random initialization
  3471. vector used for encryption of this particular secret and should be a
  3472. base64 encrypted string of the 16-byte IV.
  3473. The simplest (insecure) usage is to provide the secret inline
  3474. @example
  3475. # $QEMU -object secret,id=sec0,data=letmein,format=raw
  3476. @end example
  3477. The simplest secure usage is to provide the secret via a file
  3478. # echo -n "letmein" > mypasswd.txt
  3479. # $QEMU -object secret,id=sec0,file=mypasswd.txt,format=raw
  3480. For greater security, AES-256-CBC should be used. To illustrate usage,
  3481. consider the openssl command line tool which can encrypt the data. Note
  3482. that when encrypting, the plaintext must be padded to the cipher block
  3483. size (32 bytes) using the standard PKCS#5/6 compatible padding algorithm.
  3484. First a master key needs to be created in base64 encoding:
  3485. @example
  3486. # openssl rand -base64 32 > key.b64
  3487. # KEY=$(base64 -d key.b64 | hexdump -v -e '/1 "%02X"')
  3488. @end example
  3489. Each secret to be encrypted needs to have a random initialization vector
  3490. generated. These do not need to be kept secret
  3491. @example
  3492. # openssl rand -base64 16 > iv.b64
  3493. # IV=$(base64 -d iv.b64 | hexdump -v -e '/1 "%02X"')
  3494. @end example
  3495. The secret to be defined can now be encrypted, in this case we're
  3496. telling openssl to base64 encode the result, but it could be left
  3497. as raw bytes if desired.
  3498. @example
  3499. # SECRET=$(echo -n "letmein" |
  3500. openssl enc -aes-256-cbc -a -K $KEY -iv $IV)
  3501. @end example
  3502. When launching QEMU, create a master secret pointing to @code{key.b64}
  3503. and specify that to be used to decrypt the user password. Pass the
  3504. contents of @code{iv.b64} to the second secret
  3505. @example
  3506. # $QEMU \
  3507. -object secret,id=secmaster0,format=base64,file=key.b64 \
  3508. -object secret,id=sec0,keyid=secmaster0,format=base64,\
  3509. data=$SECRET,iv=$(<iv.b64)
  3510. @end example
  3511. @end table
  3512. ETEXI
  3513. HXCOMM This is the last statement. Insert new options before this line!
  3514. STEXI
  3515. @end table
  3516. ETEXI