qemu-options.hx 208 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031
  1. HXCOMM Use DEFHEADING() to define headings in both help text and rST.
  2. HXCOMM Text between SRST and ERST is copied to the rST 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 rST and C.
  8. DEFHEADING(Standard options:)
  9. DEF("help", 0, QEMU_OPTION_h,
  10. "-h or -help display this help and exit\n", QEMU_ARCH_ALL)
  11. SRST
  12. ``-h``
  13. Display help and exit
  14. ERST
  15. DEF("version", 0, QEMU_OPTION_version,
  16. "-version display version information and exit\n", QEMU_ARCH_ALL)
  17. SRST
  18. ``-version``
  19. Display version information and exit
  20. ERST
  21. DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
  22. "-machine [type=]name[,prop[=value][,...]]\n"
  23. " selects emulated machine ('-machine help' for list)\n"
  24. " property accel=accel1[:accel2[:...]] selects accelerator\n"
  25. " supported accelerators are kvm, xen, hax, hvf, whpx or tcg (default: tcg)\n"
  26. " vmport=on|off|auto controls emulation of vmport (default: auto)\n"
  27. " dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
  28. " mem-merge=on|off controls memory merge support (default: on)\n"
  29. " aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n"
  30. " dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n"
  31. " suppress-vmdesc=on|off disables self-describing migration (default=off)\n"
  32. " nvdimm=on|off controls NVDIMM support (default=off)\n"
  33. " enforce-config-section=on|off enforce configuration section migration (default=off)\n"
  34. " memory-encryption=@var{} memory encryption object to use (default=none)\n"
  35. " hmat=on|off controls ACPI HMAT support (default=off)\n",
  36. QEMU_ARCH_ALL)
  37. SRST
  38. ``-machine [type=]name[,prop=value[,...]]``
  39. Select the emulated machine by name. Use ``-machine help`` to list
  40. available machines.
  41. For architectures which aim to support live migration compatibility
  42. across releases, each release will introduce a new versioned machine
  43. type. For example, the 2.8.0 release introduced machine types
  44. "pc-i440fx-2.8" and "pc-q35-2.8" for the x86\_64/i686 architectures.
  45. To allow live migration of guests from QEMU version 2.8.0, to QEMU
  46. version 2.9.0, the 2.9.0 version must support the "pc-i440fx-2.8"
  47. and "pc-q35-2.8" machines too. To allow users live migrating VMs to
  48. skip multiple intermediate releases when upgrading, new releases of
  49. QEMU will support machine types from many previous versions.
  50. Supported machine properties are:
  51. ``accel=accels1[:accels2[:...]]``
  52. This is used to enable an accelerator. Depending on the target
  53. architecture, kvm, xen, hax, hvf, whpx or tcg can be available.
  54. By default, tcg is used. If there is more than one accelerator
  55. specified, the next one is used if the previous one fails to
  56. initialize.
  57. ``vmport=on|off|auto``
  58. Enables emulation of VMWare IO port, for vmmouse etc. auto says
  59. to select the value based on accel. For accel=xen the default is
  60. off otherwise the default is on.
  61. ``dump-guest-core=on|off``
  62. Include guest memory in a core dump. The default is on.
  63. ``mem-merge=on|off``
  64. Enables or disables memory merge support. This feature, when
  65. supported by the host, de-duplicates identical memory pages
  66. among VMs instances (enabled by default).
  67. ``aes-key-wrap=on|off``
  68. Enables or disables AES key wrapping support on s390-ccw hosts.
  69. This feature controls whether AES wrapping keys will be created
  70. to allow execution of AES cryptographic functions. The default
  71. is on.
  72. ``dea-key-wrap=on|off``
  73. Enables or disables DEA key wrapping support on s390-ccw hosts.
  74. This feature controls whether DEA wrapping keys will be created
  75. to allow execution of DEA cryptographic functions. The default
  76. is on.
  77. ``nvdimm=on|off``
  78. Enables or disables NVDIMM support. The default is off.
  79. ``enforce-config-section=on|off``
  80. If ``enforce-config-section`` is set to on, force migration code
  81. to send configuration section even if the machine-type sets the
  82. ``migration.send-configuration`` property to off. NOTE: this
  83. parameter is deprecated. Please use ``-global``
  84. ``migration.send-configuration``\ =on\|off instead.
  85. ``memory-encryption=``
  86. Memory encryption object to use. The default is none.
  87. ``hmat=on|off``
  88. Enables or disables ACPI Heterogeneous Memory Attribute Table
  89. (HMAT) support. The default is off.
  90. ERST
  91. HXCOMM Deprecated by -machine
  92. DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
  93. DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
  94. "-cpu cpu select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
  95. SRST
  96. ``-cpu model``
  97. Select CPU model (``-cpu help`` for list and additional feature
  98. selection)
  99. ERST
  100. DEF("accel", HAS_ARG, QEMU_OPTION_accel,
  101. "-accel [accel=]accelerator[,prop[=value][,...]]\n"
  102. " select accelerator (kvm, xen, hax, hvf, whpx or tcg; use 'help' for a list)\n"
  103. " igd-passthru=on|off (enable Xen integrated Intel graphics passthrough, default=off)\n"
  104. " kernel-irqchip=on|off|split controls accelerated irqchip support (default=on)\n"
  105. " kvm-shadow-mem=size of KVM shadow MMU in bytes\n"
  106. " tb-size=n (TCG translation block cache size)\n"
  107. " thread=single|multi (enable multi-threaded TCG)\n", QEMU_ARCH_ALL)
  108. SRST
  109. ``-accel name[,prop=value[,...]]``
  110. This is used to enable an accelerator. Depending on the target
  111. architecture, kvm, xen, hax, hvf, whpx or tcg can be available. By
  112. default, tcg is used. If there is more than one accelerator
  113. specified, the next one is used if the previous one fails to
  114. initialize.
  115. ``igd-passthru=on|off``
  116. When Xen is in use, this option controls whether Intel
  117. integrated graphics devices can be passed through to the guest
  118. (default=off)
  119. ``kernel-irqchip=on|off|split``
  120. Controls KVM in-kernel irqchip support. The default is full
  121. acceleration of the interrupt controllers. On x86, split irqchip
  122. reduces the kernel attack surface, at a performance cost for
  123. non-MSI interrupts. Disabling the in-kernel irqchip completely
  124. is not recommended except for debugging purposes.
  125. ``kvm-shadow-mem=size``
  126. Defines the size of the KVM shadow MMU.
  127. ``tb-size=n``
  128. Controls the size (in MiB) of the TCG translation block cache.
  129. ``thread=single|multi``
  130. Controls number of TCG threads. When the TCG is multi-threaded
  131. there will be one thread per vCPU therefor taking advantage of
  132. additional host cores. The default is to enable multi-threading
  133. where both the back-end and front-ends support it and no
  134. incompatible TCG features have been enabled (e.g.
  135. icount/replay).
  136. ERST
  137. DEF("smp", HAS_ARG, QEMU_OPTION_smp,
  138. "-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,dies=dies][,sockets=sockets]\n"
  139. " set the number of CPUs to 'n' [default=1]\n"
  140. " maxcpus= maximum number of total cpus, including\n"
  141. " offline CPUs for hotplug, etc\n"
  142. " cores= number of CPU cores on one socket (for PC, it's on one die)\n"
  143. " threads= number of threads on one CPU core\n"
  144. " dies= number of CPU dies on one socket (for PC only)\n"
  145. " sockets= number of discrete sockets in the system\n",
  146. QEMU_ARCH_ALL)
  147. SRST
  148. ``-smp [cpus=]n[,cores=cores][,threads=threads][,dies=dies][,sockets=sockets][,maxcpus=maxcpus]``
  149. Simulate an SMP system with n CPUs. On the PC target, up to 255 CPUs
  150. are supported. On Sparc32 target, Linux limits the number of usable
  151. CPUs to 4. For the PC target, the number of cores per die, the
  152. number of threads per cores, the number of dies per packages and the
  153. total number of sockets can be specified. Missing values will be
  154. computed. If any on the three values is given, the total number of
  155. CPUs n can be omitted. maxcpus specifies the maximum number of
  156. hotpluggable CPUs.
  157. ERST
  158. DEF("numa", HAS_ARG, QEMU_OPTION_numa,
  159. "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n"
  160. "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=node]\n"
  161. "-numa dist,src=source,dst=destination,val=distance\n"
  162. "-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]\n"
  163. "-numa hmat-lb,initiator=node,target=node,hierarchy=memory|first-level|second-level|third-level,data-type=access-latency|read-latency|write-latency[,latency=lat][,bandwidth=bw]\n"
  164. "-numa hmat-cache,node-id=node,size=size,level=level[,associativity=none|direct|complex][,policy=none|write-back|write-through][,line=size]\n",
  165. QEMU_ARCH_ALL)
  166. SRST
  167. ``-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]``
  168. \
  169. ``-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node][,initiator=initiator]``
  170. \
  171. ``-numa dist,src=source,dst=destination,val=distance``
  172. \
  173. ``-numa cpu,node-id=node[,socket-id=x][,core-id=y][,thread-id=z]``
  174. \
  175. ``-numa hmat-lb,initiator=node,target=node,hierarchy=hierarchy,data-type=tpye[,latency=lat][,bandwidth=bw]``
  176. \
  177. ``-numa hmat-cache,node-id=node,size=size,level=level[,associativity=str][,policy=str][,line=size]``
  178. Define a NUMA node and assign RAM and VCPUs to it. Set the NUMA
  179. distance from a source node to a destination node. Set the ACPI
  180. Heterogeneous Memory Attributes for the given nodes.
  181. Legacy VCPU assignment uses '\ ``cpus``\ ' option where firstcpu and
  182. lastcpu are CPU indexes. Each '\ ``cpus``\ ' option represent a
  183. contiguous range of CPU indexes (or a single VCPU if lastcpu is
  184. omitted). A non-contiguous set of VCPUs can be represented by
  185. providing multiple '\ ``cpus``\ ' options. If '\ ``cpus``\ ' is
  186. omitted on all nodes, VCPUs are automatically split between them.
  187. For example, the following option assigns VCPUs 0, 1, 2 and 5 to a
  188. NUMA node:
  189. ::
  190. -numa node,cpus=0-2,cpus=5
  191. '\ ``cpu``\ ' option is a new alternative to '\ ``cpus``\ ' option
  192. which uses '\ ``socket-id|core-id|thread-id``\ ' properties to
  193. assign CPU objects to a node using topology layout properties of
  194. CPU. The set of properties is machine specific, and depends on used
  195. machine type/'\ ``smp``\ ' options. It could be queried with
  196. '\ ``hotpluggable-cpus``\ ' monitor command. '\ ``node-id``\ '
  197. property specifies node to which CPU object will be assigned, it's
  198. required for node to be declared with '\ ``node``\ ' option before
  199. it's used with '\ ``cpu``\ ' option.
  200. For example:
  201. ::
  202. -M pc \
  203. -smp 1,sockets=2,maxcpus=2 \
  204. -numa node,nodeid=0 -numa node,nodeid=1 \
  205. -numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1
  206. '\ ``mem``\ ' assigns a given RAM amount to a node. '\ ``memdev``\ '
  207. assigns RAM from a given memory backend device to a node. If
  208. '\ ``mem``\ ' and '\ ``memdev``\ ' are omitted in all nodes, RAM is
  209. split equally between them.
  210. '\ ``mem``\ ' and '\ ``memdev``\ ' are mutually exclusive.
  211. Furthermore, if one node uses '\ ``memdev``\ ', all of them have to
  212. use it.
  213. '\ ``initiator``\ ' is an additional option that points to an
  214. initiator NUMA node that has best performance (the lowest latency or
  215. largest bandwidth) to this NUMA node. Note that this option can be
  216. set only when the machine property 'hmat' is set to 'on'.
  217. Following example creates a machine with 2 NUMA nodes, node 0 has
  218. CPU. node 1 has only memory, and its initiator is node 0. Note that
  219. because node 0 has CPU, by default the initiator of node 0 is itself
  220. and must be itself.
  221. ::
  222. -machine hmat=on \
  223. -m 2G,slots=2,maxmem=4G \
  224. -object memory-backend-ram,size=1G,id=m0 \
  225. -object memory-backend-ram,size=1G,id=m1 \
  226. -numa node,nodeid=0,memdev=m0 \
  227. -numa node,nodeid=1,memdev=m1,initiator=0 \
  228. -smp 2,sockets=2,maxcpus=2 \
  229. -numa cpu,node-id=0,socket-id=0 \
  230. -numa cpu,node-id=0,socket-id=1
  231. source and destination are NUMA node IDs. distance is the NUMA
  232. distance from source to destination. The distance from a node to
  233. itself is always 10. If any pair of nodes is given a distance, then
  234. all pairs must be given distances. Although, when distances are only
  235. given in one direction for each pair of nodes, then the distances in
  236. the opposite directions are assumed to be the same. If, however, an
  237. asymmetrical pair of distances is given for even one node pair, then
  238. all node pairs must be provided distance values for both directions,
  239. even when they are symmetrical. When a node is unreachable from
  240. another node, set the pair's distance to 255.
  241. Note that the -``numa`` option doesn't allocate any of the specified
  242. resources, it just assigns existing resources to NUMA nodes. This
  243. means that one still has to use the ``-m``, ``-smp`` options to
  244. allocate RAM and VCPUs respectively.
  245. Use '\ ``hmat-lb``\ ' to set System Locality Latency and Bandwidth
  246. Information between initiator and target NUMA nodes in ACPI
  247. Heterogeneous Attribute Memory Table (HMAT). Initiator NUMA node can
  248. create memory requests, usually it has one or more processors.
  249. Target NUMA node contains addressable memory.
  250. In '\ ``hmat-lb``\ ' option, node are NUMA node IDs. hierarchy is
  251. the memory hierarchy of the target NUMA node: if hierarchy is
  252. 'memory', the structure represents the memory performance; if
  253. hierarchy is 'first-level\|second-level\|third-level', this
  254. structure represents aggregated performance of memory side caches
  255. for each domain. type of 'data-type' is type of data represented by
  256. this structure instance: if 'hierarchy' is 'memory', 'data-type' is
  257. 'access\|read\|write' latency or 'access\|read\|write' bandwidth of
  258. the target memory; if 'hierarchy' is
  259. 'first-level\|second-level\|third-level', 'data-type' is
  260. 'access\|read\|write' hit latency or 'access\|read\|write' hit
  261. bandwidth of the target memory side cache.
  262. lat is latency value in nanoseconds. bw is bandwidth value, the
  263. possible value and units are NUM[M\|G\|T], mean that the bandwidth
  264. value are NUM byte per second (or MB/s, GB/s or TB/s depending on
  265. used suffix). Note that if latency or bandwidth value is 0, means
  266. the corresponding latency or bandwidth information is not provided.
  267. In '\ ``hmat-cache``\ ' option, node-id is the NUMA-id of the memory
  268. belongs. size is the size of memory side cache in bytes. level is
  269. the cache level described in this structure, note that the cache
  270. level 0 should not be used with '\ ``hmat-cache``\ ' option.
  271. associativity is the cache associativity, the possible value is
  272. 'none/direct(direct-mapped)/complex(complex cache indexing)'. policy
  273. is the write policy. line is the cache Line size in bytes.
  274. For example, the following options describe 2 NUMA nodes. Node 0 has
  275. 2 cpus and a ram, node 1 has only a ram. The processors in node 0
  276. access memory in node 0 with access-latency 5 nanoseconds,
  277. access-bandwidth is 200 MB/s; The processors in NUMA node 0 access
  278. memory in NUMA node 1 with access-latency 10 nanoseconds,
  279. access-bandwidth is 100 MB/s. And for memory side cache information,
  280. NUMA node 0 and 1 both have 1 level memory cache, size is 10KB,
  281. policy is write-back, the cache Line size is 8 bytes:
  282. ::
  283. -machine hmat=on \
  284. -m 2G \
  285. -object memory-backend-ram,size=1G,id=m0 \
  286. -object memory-backend-ram,size=1G,id=m1 \
  287. -smp 2 \
  288. -numa node,nodeid=0,memdev=m0 \
  289. -numa node,nodeid=1,memdev=m1,initiator=0 \
  290. -numa cpu,node-id=0,socket-id=0 \
  291. -numa cpu,node-id=0,socket-id=1 \
  292. -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-latency,latency=5 \
  293. -numa hmat-lb,initiator=0,target=0,hierarchy=memory,data-type=access-bandwidth,bandwidth=200M \
  294. -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-latency,latency=10 \
  295. -numa hmat-lb,initiator=0,target=1,hierarchy=memory,data-type=access-bandwidth,bandwidth=100M \
  296. -numa hmat-cache,node-id=0,size=10K,level=1,associativity=direct,policy=write-back,line=8 \
  297. -numa hmat-cache,node-id=1,size=10K,level=1,associativity=direct,policy=write-back,line=8
  298. ERST
  299. DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd,
  300. "-add-fd fd=fd,set=set[,opaque=opaque]\n"
  301. " Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL)
  302. SRST
  303. ``-add-fd fd=fd,set=set[,opaque=opaque]``
  304. Add a file descriptor to an fd set. Valid options are:
  305. ``fd=fd``
  306. This option defines the file descriptor of which a duplicate is
  307. added to fd set. The file descriptor cannot be stdin, stdout, or
  308. stderr.
  309. ``set=set``
  310. This option defines the ID of the fd set to add the file
  311. descriptor to.
  312. ``opaque=opaque``
  313. This option defines a free-form string that can be used to
  314. describe fd.
  315. You can open an image using pre-opened file descriptors from an fd
  316. set:
  317. .. parsed-literal::
  318. |qemu_system| \
  319. -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \
  320. -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \
  321. -drive file=/dev/fdset/2,index=0,media=disk
  322. ERST
  323. DEF("set", HAS_ARG, QEMU_OPTION_set,
  324. "-set group.id.arg=value\n"
  325. " set <arg> parameter for item <id> of type <group>\n"
  326. " i.e. -set drive.$id.file=/path/to/image\n", QEMU_ARCH_ALL)
  327. SRST
  328. ``-set group.id.arg=value``
  329. Set parameter arg for item id of type group
  330. ERST
  331. DEF("global", HAS_ARG, QEMU_OPTION_global,
  332. "-global driver.property=value\n"
  333. "-global driver=driver,property=property,value=value\n"
  334. " set a global default for a driver property\n",
  335. QEMU_ARCH_ALL)
  336. SRST
  337. ``-global driver.prop=value``
  338. \
  339. ``-global driver=driver,property=property,value=value``
  340. Set default value of driver's property prop to value, e.g.:
  341. .. parsed-literal::
  342. |qemu_system_x86| -global ide-hd.physical_block_size=4096 disk-image.img
  343. In particular, you can use this to set driver properties for devices
  344. which are created automatically by the machine model. To create a
  345. device which is not created automatically and set properties on it,
  346. use -``device``.
  347. -global driver.prop=value is shorthand for -global
  348. driver=driver,property=prop,value=value. The longhand syntax works
  349. even when driver contains a dot.
  350. ERST
  351. DEF("boot", HAS_ARG, QEMU_OPTION_boot,
  352. "-boot [order=drives][,once=drives][,menu=on|off]\n"
  353. " [,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_time][,strict=on|off]\n"
  354. " 'drives': floppy (a), hard disk (c), CD-ROM (d), network (n)\n"
  355. " 'sp_name': the file's name that would be passed to bios as logo picture, if menu=on\n"
  356. " 'sp_time': the period that splash picture last if menu=on, unit is ms\n"
  357. " 'rb_timeout': the timeout before guest reboot when boot failed, unit is ms\n",
  358. QEMU_ARCH_ALL)
  359. SRST
  360. ``-boot [order=drives][,once=drives][,menu=on|off][,splash=sp_name][,splash-time=sp_time][,reboot-timeout=rb_timeout][,strict=on|off]``
  361. Specify boot order drives as a string of drive letters. Valid drive
  362. letters depend on the target architecture. The x86 PC uses: a, b
  363. (floppy 1 and 2), c (first hard disk), d (first CD-ROM), n-p
  364. (Etherboot from network adapter 1-4), hard disk boot is the default.
  365. To apply a particular boot order only on the first startup, specify
  366. it via ``once``. Note that the ``order`` or ``once`` parameter
  367. should not be used together with the ``bootindex`` property of
  368. devices, since the firmware implementations normally do not support
  369. both at the same time.
  370. Interactive boot menus/prompts can be enabled via ``menu=on`` as far
  371. as firmware/BIOS supports them. The default is non-interactive boot.
  372. A splash picture could be passed to bios, enabling user to show it
  373. as logo, when option splash=sp\_name is given and menu=on, If
  374. firmware/BIOS supports them. Currently Seabios for X86 system
  375. support it. limitation: The splash file could be a jpeg file or a
  376. BMP file in 24 BPP format(true color). The resolution should be
  377. supported by the SVGA mode, so the recommended is 320x240, 640x480,
  378. 800x640.
  379. A timeout could be passed to bios, guest will pause for rb\_timeout
  380. ms when boot failed, then reboot. If rb\_timeout is '-1', guest will
  381. not reboot, qemu passes '-1' to bios by default. Currently Seabios
  382. for X86 system support it.
  383. Do strict boot via ``strict=on`` as far as firmware/BIOS supports
  384. it. This only effects when boot priority is changed by bootindex
  385. options. The default is non-strict boot.
  386. .. parsed-literal::
  387. # try to boot from network first, then from hard disk
  388. |qemu_system_x86| -boot order=nc
  389. # boot from CD-ROM first, switch back to default order after reboot
  390. |qemu_system_x86| -boot once=d
  391. # boot with a splash picture for 5 seconds.
  392. |qemu_system_x86| -boot menu=on,splash=/root/boot.bmp,splash-time=5000
  393. Note: The legacy format '-boot drives' is still supported but its
  394. use is discouraged as it may be removed from future versions.
  395. ERST
  396. DEF("m", HAS_ARG, QEMU_OPTION_m,
  397. "-m [size=]megs[,slots=n,maxmem=size]\n"
  398. " configure guest RAM\n"
  399. " size: initial amount of guest memory\n"
  400. " slots: number of hotplug slots (default: none)\n"
  401. " maxmem: maximum amount of guest memory (default: none)\n"
  402. "NOTE: Some architectures might enforce a specific granularity\n",
  403. QEMU_ARCH_ALL)
  404. SRST
  405. ``-m [size=]megs[,slots=n,maxmem=size]``
  406. Sets guest startup RAM size to megs megabytes. Default is 128 MiB.
  407. Optionally, a suffix of "M" or "G" can be used to signify a value in
  408. megabytes or gigabytes respectively. Optional pair slots, maxmem
  409. could be used to set amount of hotpluggable memory slots and maximum
  410. amount of memory. Note that maxmem must be aligned to the page size.
  411. For example, the following command-line sets the guest startup RAM
  412. size to 1GB, creates 3 slots to hotplug additional memory and sets
  413. the maximum memory the guest can reach to 4GB:
  414. .. parsed-literal::
  415. |qemu_system| -m 1G,slots=3,maxmem=4G
  416. If slots and maxmem are not specified, memory hotplug won't be
  417. enabled and the guest startup RAM will never increase.
  418. ERST
  419. DEF("mem-path", HAS_ARG, QEMU_OPTION_mempath,
  420. "-mem-path FILE provide backing storage for guest RAM\n", QEMU_ARCH_ALL)
  421. SRST
  422. ``-mem-path path``
  423. Allocate guest RAM from a temporarily created file in path.
  424. ERST
  425. DEF("mem-prealloc", 0, QEMU_OPTION_mem_prealloc,
  426. "-mem-prealloc preallocate guest memory (use with -mem-path)\n",
  427. QEMU_ARCH_ALL)
  428. SRST
  429. ``-mem-prealloc``
  430. Preallocate memory when using -mem-path.
  431. ERST
  432. DEF("k", HAS_ARG, QEMU_OPTION_k,
  433. "-k language use keyboard layout (for example 'fr' for French)\n",
  434. QEMU_ARCH_ALL)
  435. SRST
  436. ``-k language``
  437. Use keyboard layout language (for example ``fr`` for French). This
  438. option is only needed where it is not easy to get raw PC keycodes
  439. (e.g. on Macs, with some X11 servers or with a VNC or curses
  440. display). You don't normally need to use it on PC/Linux or
  441. PC/Windows hosts.
  442. The available layouts are:
  443. ::
  444. ar de-ch es fo fr-ca hu ja mk no pt-br sv
  445. da en-gb et fr fr-ch is lt nl pl ru th
  446. de en-us fi fr-be hr it lv nl-be pt sl tr
  447. The default is ``en-us``.
  448. ERST
  449. HXCOMM Deprecated by -audiodev
  450. DEF("audio-help", 0, QEMU_OPTION_audio_help,
  451. "-audio-help show -audiodev equivalent of the currently specified audio settings\n",
  452. QEMU_ARCH_ALL)
  453. SRST
  454. ``-audio-help``
  455. Will show the -audiodev equivalent of the currently specified
  456. (deprecated) environment variables.
  457. ERST
  458. DEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev,
  459. "-audiodev [driver=]driver,id=id[,prop[=value][,...]]\n"
  460. " specifies the audio backend to use\n"
  461. " id= identifier of the backend\n"
  462. " timer-period= timer period in microseconds\n"
  463. " in|out.mixing-engine= use mixing engine to mix streams inside QEMU\n"
  464. " in|out.fixed-settings= use fixed settings for host audio\n"
  465. " in|out.frequency= frequency to use with fixed settings\n"
  466. " in|out.channels= number of channels to use with fixed settings\n"
  467. " in|out.format= sample format to use with fixed settings\n"
  468. " valid values: s8, s16, s32, u8, u16, u32, f32\n"
  469. " in|out.voices= number of voices to use\n"
  470. " in|out.buffer-length= length of buffer in microseconds\n"
  471. "-audiodev none,id=id,[,prop[=value][,...]]\n"
  472. " dummy driver that discards all output\n"
  473. #ifdef CONFIG_AUDIO_ALSA
  474. "-audiodev alsa,id=id[,prop[=value][,...]]\n"
  475. " in|out.dev= name of the audio device to use\n"
  476. " in|out.period-length= length of period in microseconds\n"
  477. " in|out.try-poll= attempt to use poll mode\n"
  478. " threshold= threshold (in microseconds) when playback starts\n"
  479. #endif
  480. #ifdef CONFIG_AUDIO_COREAUDIO
  481. "-audiodev coreaudio,id=id[,prop[=value][,...]]\n"
  482. " in|out.buffer-count= number of buffers\n"
  483. #endif
  484. #ifdef CONFIG_AUDIO_DSOUND
  485. "-audiodev dsound,id=id[,prop[=value][,...]]\n"
  486. " latency= add extra latency to playback in microseconds\n"
  487. #endif
  488. #ifdef CONFIG_AUDIO_OSS
  489. "-audiodev oss,id=id[,prop[=value][,...]]\n"
  490. " in|out.dev= path of the audio device to use\n"
  491. " in|out.buffer-count= number of buffers\n"
  492. " in|out.try-poll= attempt to use poll mode\n"
  493. " try-mmap= try using memory mapped access\n"
  494. " exclusive= open device in exclusive mode\n"
  495. " dsp-policy= set timing policy (0..10), -1 to use fragment mode\n"
  496. #endif
  497. #ifdef CONFIG_AUDIO_PA
  498. "-audiodev pa,id=id[,prop[=value][,...]]\n"
  499. " server= PulseAudio server address\n"
  500. " in|out.name= source/sink device name\n"
  501. " in|out.latency= desired latency in microseconds\n"
  502. #endif
  503. #ifdef CONFIG_AUDIO_SDL
  504. "-audiodev sdl,id=id[,prop[=value][,...]]\n"
  505. #endif
  506. #ifdef CONFIG_SPICE
  507. "-audiodev spice,id=id[,prop[=value][,...]]\n"
  508. #endif
  509. "-audiodev wav,id=id[,prop[=value][,...]]\n"
  510. " path= path of wav file to record\n",
  511. QEMU_ARCH_ALL)
  512. SRST
  513. ``-audiodev [driver=]driver,id=id[,prop[=value][,...]]``
  514. Adds a new audio backend driver identified by id. There are global
  515. and driver specific properties. Some values can be set differently
  516. for input and output, they're marked with ``in|out.``. You can set
  517. the input's property with ``in.prop`` and the output's property with
  518. ``out.prop``. For example:
  519. ::
  520. -audiodev alsa,id=example,in.frequency=44110,out.frequency=8000
  521. -audiodev alsa,id=example,out.channels=1 # leaves in.channels unspecified
  522. NOTE: parameter validation is known to be incomplete, in many cases
  523. specifying an invalid option causes QEMU to print an error message
  524. and continue emulation without sound.
  525. Valid global options are:
  526. ``id=identifier``
  527. Identifies the audio backend.
  528. ``timer-period=period``
  529. Sets the timer period used by the audio subsystem in
  530. microseconds. Default is 10000 (10 ms).
  531. ``in|out.mixing-engine=on|off``
  532. Use QEMU's mixing engine to mix all streams inside QEMU and
  533. convert audio formats when not supported by the backend. When
  534. off, fixed-settings must be off too. Note that disabling this
  535. option means that the selected backend must support multiple
  536. streams and the audio formats used by the virtual cards,
  537. otherwise you'll get no sound. It's not recommended to disable
  538. this option unless you want to use 5.1 or 7.1 audio, as mixing
  539. engine only supports mono and stereo audio. Default is on.
  540. ``in|out.fixed-settings=on|off``
  541. Use fixed settings for host audio. When off, it will change
  542. based on how the guest opens the sound card. In this case you
  543. must not specify frequency, channels or format. Default is on.
  544. ``in|out.frequency=frequency``
  545. Specify the frequency to use when using fixed-settings. Default
  546. is 44100Hz.
  547. ``in|out.channels=channels``
  548. Specify the number of channels to use when using fixed-settings.
  549. Default is 2 (stereo).
  550. ``in|out.format=format``
  551. Specify the sample format to use when using fixed-settings.
  552. Valid values are: ``s8``, ``s16``, ``s32``, ``u8``, ``u16``,
  553. ``u32``, ``f32``. Default is ``s16``.
  554. ``in|out.voices=voices``
  555. Specify the number of voices to use. Default is 1.
  556. ``in|out.buffer-length=usecs``
  557. Sets the size of the buffer in microseconds.
  558. ``-audiodev none,id=id[,prop[=value][,...]]``
  559. Creates a dummy backend that discards all outputs. This backend has
  560. no backend specific properties.
  561. ``-audiodev alsa,id=id[,prop[=value][,...]]``
  562. Creates backend using the ALSA. This backend is only available on
  563. Linux.
  564. ALSA specific options are:
  565. ``in|out.dev=device``
  566. Specify the ALSA device to use for input and/or output. Default
  567. is ``default``.
  568. ``in|out.period-length=usecs``
  569. Sets the period length in microseconds.
  570. ``in|out.try-poll=on|off``
  571. Attempt to use poll mode with the device. Default is on.
  572. ``threshold=threshold``
  573. Threshold (in microseconds) when playback starts. Default is 0.
  574. ``-audiodev coreaudio,id=id[,prop[=value][,...]]``
  575. Creates a backend using Apple's Core Audio. This backend is only
  576. available on Mac OS and only supports playback.
  577. Core Audio specific options are:
  578. ``in|out.buffer-count=count``
  579. Sets the count of the buffers.
  580. ``-audiodev dsound,id=id[,prop[=value][,...]]``
  581. Creates a backend using Microsoft's DirectSound. This backend is
  582. only available on Windows and only supports playback.
  583. DirectSound specific options are:
  584. ``latency=usecs``
  585. Add extra usecs microseconds latency to playback. Default is
  586. 10000 (10 ms).
  587. ``-audiodev oss,id=id[,prop[=value][,...]]``
  588. Creates a backend using OSS. This backend is available on most
  589. Unix-like systems.
  590. OSS specific options are:
  591. ``in|out.dev=device``
  592. Specify the file name of the OSS device to use. Default is
  593. ``/dev/dsp``.
  594. ``in|out.buffer-count=count``
  595. Sets the count of the buffers.
  596. ``in|out.try-poll=on|of``
  597. Attempt to use poll mode with the device. Default is on.
  598. ``try-mmap=on|off``
  599. Try using memory mapped device access. Default is off.
  600. ``exclusive=on|off``
  601. Open the device in exclusive mode (vmix won't work in this
  602. case). Default is off.
  603. ``dsp-policy=policy``
  604. Sets the timing policy (between 0 and 10, where smaller number
  605. means smaller latency but higher CPU usage). Use -1 to use
  606. buffer sizes specified by ``buffer`` and ``buffer-count``. This
  607. option is ignored if you do not have OSS 4. Default is 5.
  608. ``-audiodev pa,id=id[,prop[=value][,...]]``
  609. Creates a backend using PulseAudio. This backend is available on
  610. most systems.
  611. PulseAudio specific options are:
  612. ``server=server``
  613. Sets the PulseAudio server to connect to.
  614. ``in|out.name=sink``
  615. Use the specified source/sink for recording/playback.
  616. ``in|out.latency=usecs``
  617. Desired latency in microseconds. The PulseAudio server will try
  618. to honor this value but actual latencies may be lower or higher.
  619. ``-audiodev sdl,id=id[,prop[=value][,...]]``
  620. Creates a backend using SDL. This backend is available on most
  621. systems, but you should use your platform's native backend if
  622. possible. This backend has no backend specific properties.
  623. ``-audiodev spice,id=id[,prop[=value][,...]]``
  624. Creates a backend that sends audio through SPICE. This backend
  625. requires ``-spice`` and automatically selected in that case, so
  626. usually you can ignore this option. This backend has no backend
  627. specific properties.
  628. ``-audiodev wav,id=id[,prop[=value][,...]]``
  629. Creates a backend that writes audio to a WAV file.
  630. Backend specific options are:
  631. ``path=path``
  632. Write recorded audio into the specified file. Default is
  633. ``qemu.wav``.
  634. ERST
  635. DEF("soundhw", HAS_ARG, QEMU_OPTION_soundhw,
  636. "-soundhw c1,... enable audio support\n"
  637. " and only specified sound cards (comma separated list)\n"
  638. " use '-soundhw help' to get the list of supported cards\n"
  639. " use '-soundhw all' to enable all of them\n", QEMU_ARCH_ALL)
  640. SRST
  641. ``-soundhw card1[,card2,...] or -soundhw all``
  642. Enable audio and selected sound hardware. Use 'help' to print all
  643. available sound hardware. For example:
  644. .. parsed-literal::
  645. |qemu_system_x86| -soundhw sb16,adlib disk.img
  646. |qemu_system_x86| -soundhw es1370 disk.img
  647. |qemu_system_x86| -soundhw ac97 disk.img
  648. |qemu_system_x86| -soundhw hda disk.img
  649. |qemu_system_x86| -soundhw all disk.img
  650. |qemu_system_x86| -soundhw help
  651. Note that Linux's i810\_audio OSS kernel (for AC97) module might
  652. require manually specifying clocking.
  653. ::
  654. modprobe i810_audio clocking=48000
  655. ERST
  656. DEF("device", HAS_ARG, QEMU_OPTION_device,
  657. "-device driver[,prop[=value][,...]]\n"
  658. " add device (based on driver)\n"
  659. " prop=value,... sets driver properties\n"
  660. " use '-device help' to print all possible drivers\n"
  661. " use '-device driver,help' to print all possible properties\n",
  662. QEMU_ARCH_ALL)
  663. SRST
  664. ``-device driver[,prop[=value][,...]]``
  665. Add device driver. prop=value sets driver properties. Valid
  666. properties depend on the driver. To get help on possible drivers and
  667. properties, use ``-device help`` and ``-device driver,help``.
  668. Some drivers are:
  669. ``-device ipmi-bmc-sim,id=id[,slave_addr=val][,sdrfile=file][,furareasize=val][,furdatafile=file][,guid=uuid]``
  670. Add an IPMI BMC. This is a simulation of a hardware management
  671. interface processor that normally sits on a system. It provides a
  672. watchdog and the ability to reset and power control the system. You
  673. need to connect this to an IPMI interface to make it useful
  674. The IPMI slave address to use for the BMC. The default is 0x20. This
  675. address is the BMC's address on the I2C network of management
  676. controllers. If you don't know what this means, it is safe to ignore
  677. it.
  678. ``id=id``
  679. The BMC id for interfaces to use this device.
  680. ``slave_addr=val``
  681. Define slave address to use for the BMC. The default is 0x20.
  682. ``sdrfile=file``
  683. file containing raw Sensor Data Records (SDR) data. The default
  684. is none.
  685. ``fruareasize=val``
  686. size of a Field Replaceable Unit (FRU) area. The default is
  687. 1024.
  688. ``frudatafile=file``
  689. file containing raw Field Replaceable Unit (FRU) inventory data.
  690. The default is none.
  691. ``guid=uuid``
  692. value for the GUID for the BMC, in standard UUID format. If this
  693. is set, get "Get GUID" command to the BMC will return it.
  694. Otherwise "Get GUID" will return an error.
  695. ``-device ipmi-bmc-extern,id=id,chardev=id[,slave_addr=val]``
  696. Add a connection to an external IPMI BMC simulator. Instead of
  697. locally emulating the BMC like the above item, instead connect to an
  698. external entity that provides the IPMI services.
  699. A connection is made to an external BMC simulator. If you do this,
  700. it is strongly recommended that you use the "reconnect=" chardev
  701. option to reconnect to the simulator if the connection is lost. Note
  702. that if this is not used carefully, it can be a security issue, as
  703. the interface has the ability to send resets, NMIs, and power off
  704. the VM. It's best if QEMU makes a connection to an external
  705. simulator running on a secure port on localhost, so neither the
  706. simulator nor QEMU is exposed to any outside network.
  707. See the "lanserv/README.vm" file in the OpenIPMI library for more
  708. details on the external interface.
  709. ``-device isa-ipmi-kcs,bmc=id[,ioport=val][,irq=val]``
  710. Add a KCS IPMI interafce on the ISA bus. This also adds a
  711. corresponding ACPI and SMBIOS entries, if appropriate.
  712. ``bmc=id``
  713. The BMC to connect to, one of ipmi-bmc-sim or ipmi-bmc-extern
  714. above.
  715. ``ioport=val``
  716. Define the I/O address of the interface. The default is 0xca0
  717. for KCS.
  718. ``irq=val``
  719. Define the interrupt to use. The default is 5. To disable
  720. interrupts, set this to 0.
  721. ``-device isa-ipmi-bt,bmc=id[,ioport=val][,irq=val]``
  722. Like the KCS interface, but defines a BT interface. The default port
  723. is 0xe4 and the default interrupt is 5.
  724. ERST
  725. DEF("name", HAS_ARG, QEMU_OPTION_name,
  726. "-name string1[,process=string2][,debug-threads=on|off]\n"
  727. " set the name of the guest\n"
  728. " string1 sets the window title and string2 the process name\n"
  729. " When debug-threads is enabled, individual threads are given a separate name\n"
  730. " NOTE: The thread names are for debugging and not a stable API.\n",
  731. QEMU_ARCH_ALL)
  732. SRST
  733. ``-name name``
  734. Sets the name of the guest. This name will be displayed in the SDL
  735. window caption. The name will also be used for the VNC server. Also
  736. optionally set the top visible process name in Linux. Naming of
  737. individual threads can also be enabled on Linux to aid debugging.
  738. ERST
  739. DEF("uuid", HAS_ARG, QEMU_OPTION_uuid,
  740. "-uuid %08x-%04x-%04x-%04x-%012x\n"
  741. " specify machine UUID\n", QEMU_ARCH_ALL)
  742. SRST
  743. ``-uuid uuid``
  744. Set system UUID.
  745. ERST
  746. DEFHEADING()
  747. DEFHEADING(Block device options:)
  748. DEF("fda", HAS_ARG, QEMU_OPTION_fda,
  749. "-fda/-fdb file use 'file' as floppy disk 0/1 image\n", QEMU_ARCH_ALL)
  750. DEF("fdb", HAS_ARG, QEMU_OPTION_fdb, "", QEMU_ARCH_ALL)
  751. SRST
  752. ``-fda file``
  753. \
  754. ``-fdb file``
  755. Use file as floppy disk 0/1 image (see
  756. :ref:`disk_005fimages`).
  757. ERST
  758. DEF("hda", HAS_ARG, QEMU_OPTION_hda,
  759. "-hda/-hdb file use 'file' as IDE hard disk 0/1 image\n", QEMU_ARCH_ALL)
  760. DEF("hdb", HAS_ARG, QEMU_OPTION_hdb, "", QEMU_ARCH_ALL)
  761. DEF("hdc", HAS_ARG, QEMU_OPTION_hdc,
  762. "-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n", QEMU_ARCH_ALL)
  763. DEF("hdd", HAS_ARG, QEMU_OPTION_hdd, "", QEMU_ARCH_ALL)
  764. SRST
  765. ``-hda file``
  766. \
  767. ``-hdb file``
  768. \
  769. ``-hdc file``
  770. \
  771. ``-hdd file``
  772. Use file as hard disk 0, 1, 2 or 3 image (see
  773. :ref:`disk_005fimages`).
  774. ERST
  775. DEF("cdrom", HAS_ARG, QEMU_OPTION_cdrom,
  776. "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n",
  777. QEMU_ARCH_ALL)
  778. SRST
  779. ``-cdrom file``
  780. Use file as CD-ROM image (you cannot use ``-hdc`` and ``-cdrom`` at
  781. the same time). You can use the host CD-ROM by using ``/dev/cdrom``
  782. as filename.
  783. ERST
  784. DEF("blockdev", HAS_ARG, QEMU_OPTION_blockdev,
  785. "-blockdev [driver=]driver[,node-name=N][,discard=ignore|unmap]\n"
  786. " [,cache.direct=on|off][,cache.no-flush=on|off]\n"
  787. " [,read-only=on|off][,auto-read-only=on|off]\n"
  788. " [,force-share=on|off][,detect-zeroes=on|off|unmap]\n"
  789. " [,driver specific parameters...]\n"
  790. " configure a block backend\n", QEMU_ARCH_ALL)
  791. SRST
  792. ``-blockdev option[,option[,option[,...]]]``
  793. Define a new block driver node. Some of the options apply to all
  794. block drivers, other options are only accepted for a specific block
  795. driver. See below for a list of generic options and options for the
  796. most common block drivers.
  797. Options that expect a reference to another node (e.g. ``file``) can
  798. be given in two ways. Either you specify the node name of an already
  799. existing node (file=node-name), or you define a new node inline,
  800. adding options for the referenced node after a dot
  801. (file.filename=path,file.aio=native).
  802. A block driver node created with ``-blockdev`` can be used for a
  803. guest device by specifying its node name for the ``drive`` property
  804. in a ``-device`` argument that defines a block device.
  805. ``Valid options for any block driver node:``
  806. ``driver``
  807. Specifies the block driver to use for the given node.
  808. ``node-name``
  809. This defines the name of the block driver node by which it
  810. will be referenced later. The name must be unique, i.e. it
  811. must not match the name of a different block driver node, or
  812. (if you use ``-drive`` as well) the ID of a drive.
  813. If no node name is specified, it is automatically generated.
  814. The generated node name is not intended to be predictable
  815. and changes between QEMU invocations. For the top level, an
  816. explicit node name must be specified.
  817. ``read-only``
  818. Open the node read-only. Guest write attempts will fail.
  819. Note that some block drivers support only read-only access,
  820. either generally or in certain configurations. In this case,
  821. the default value ``read-only=off`` does not work and the
  822. option must be specified explicitly.
  823. ``auto-read-only``
  824. If ``auto-read-only=on`` is set, QEMU may fall back to
  825. read-only usage even when ``read-only=off`` is requested, or
  826. even switch between modes as needed, e.g. depending on
  827. whether the image file is writable or whether a writing user
  828. is attached to the node.
  829. ``force-share``
  830. Override the image locking system of QEMU by forcing the
  831. node to utilize weaker shared access for permissions where
  832. it would normally request exclusive access. When there is
  833. the potential for multiple instances to have the same file
  834. open (whether this invocation of QEMU is the first or the
  835. second instance), both instances must permit shared access
  836. for the second instance to succeed at opening the file.
  837. Enabling ``force-share=on`` requires ``read-only=on``.
  838. ``cache.direct``
  839. The host page cache can be avoided with ``cache.direct=on``.
  840. This will attempt to do disk IO directly to the guest's
  841. memory. QEMU may still perform an internal copy of the data.
  842. ``cache.no-flush``
  843. In case you don't care about data integrity over host
  844. failures, you can use ``cache.no-flush=on``. This option
  845. tells QEMU that it never needs to write any data to the disk
  846. but can instead keep things in cache. If anything goes
  847. wrong, like your host losing power, the disk storage getting
  848. disconnected accidentally, etc. your image will most
  849. probably be rendered unusable.
  850. ``discard=discard``
  851. discard is one of "ignore" (or "off") or "unmap" (or "on")
  852. and controls whether ``discard`` (also known as ``trim`` or
  853. ``unmap``) requests are ignored or passed to the filesystem.
  854. Some machine types may not support discard requests.
  855. ``detect-zeroes=detect-zeroes``
  856. detect-zeroes is "off", "on" or "unmap" and enables the
  857. automatic conversion of plain zero writes by the OS to
  858. driver specific optimized zero write commands. You may even
  859. choose "unmap" if discard is set to "unmap" to allow a zero
  860. write to be converted to an ``unmap`` operation.
  861. ``Driver-specific options for file``
  862. This is the protocol-level block driver for accessing regular
  863. files.
  864. ``filename``
  865. The path to the image file in the local filesystem
  866. ``aio``
  867. Specifies the AIO backend (threads/native, default: threads)
  868. ``locking``
  869. Specifies whether the image file is protected with Linux OFD
  870. / POSIX locks. The default is to use the Linux Open File
  871. Descriptor API if available, otherwise no lock is applied.
  872. (auto/on/off, default: auto)
  873. Example:
  874. ::
  875. -blockdev driver=file,node-name=disk,filename=disk.img
  876. ``Driver-specific options for raw``
  877. This is the image format block driver for raw images. It is
  878. usually stacked on top of a protocol level block driver such as
  879. ``file``.
  880. ``file``
  881. Reference to or definition of the data source block driver
  882. node (e.g. a ``file`` driver node)
  883. Example 1:
  884. ::
  885. -blockdev driver=file,node-name=disk_file,filename=disk.img
  886. -blockdev driver=raw,node-name=disk,file=disk_file
  887. Example 2:
  888. ::
  889. -blockdev driver=raw,node-name=disk,file.driver=file,file.filename=disk.img
  890. ``Driver-specific options for qcow2``
  891. This is the image format block driver for qcow2 images. It is
  892. usually stacked on top of a protocol level block driver such as
  893. ``file``.
  894. ``file``
  895. Reference to or definition of the data source block driver
  896. node (e.g. a ``file`` driver node)
  897. ``backing``
  898. Reference to or definition of the backing file block device
  899. (default is taken from the image file). It is allowed to
  900. pass ``null`` here in order to disable the default backing
  901. file.
  902. ``lazy-refcounts``
  903. Whether to enable the lazy refcounts feature (on/off;
  904. default is taken from the image file)
  905. ``cache-size``
  906. The maximum total size of the L2 table and refcount block
  907. caches in bytes (default: the sum of l2-cache-size and
  908. refcount-cache-size)
  909. ``l2-cache-size``
  910. The maximum size of the L2 table cache in bytes (default: if
  911. cache-size is not specified - 32M on Linux platforms, and 8M
  912. on non-Linux platforms; otherwise, as large as possible
  913. within the cache-size, while permitting the requested or the
  914. minimal refcount cache size)
  915. ``refcount-cache-size``
  916. The maximum size of the refcount block cache in bytes
  917. (default: 4 times the cluster size; or if cache-size is
  918. specified, the part of it which is not used for the L2
  919. cache)
  920. ``cache-clean-interval``
  921. Clean unused entries in the L2 and refcount caches. The
  922. interval is in seconds. The default value is 600 on
  923. supporting platforms, and 0 on other platforms. Setting it
  924. to 0 disables this feature.
  925. ``pass-discard-request``
  926. Whether discard requests to the qcow2 device should be
  927. forwarded to the data source (on/off; default: on if
  928. discard=unmap is specified, off otherwise)
  929. ``pass-discard-snapshot``
  930. Whether discard requests for the data source should be
  931. issued when a snapshot operation (e.g. deleting a snapshot)
  932. frees clusters in the qcow2 file (on/off; default: on)
  933. ``pass-discard-other``
  934. Whether discard requests for the data source should be
  935. issued on other occasions where a cluster gets freed
  936. (on/off; default: off)
  937. ``overlap-check``
  938. Which overlap checks to perform for writes to the image
  939. (none/constant/cached/all; default: cached). For details or
  940. finer granularity control refer to the QAPI documentation of
  941. ``blockdev-add``.
  942. Example 1:
  943. ::
  944. -blockdev driver=file,node-name=my_file,filename=/tmp/disk.qcow2
  945. -blockdev driver=qcow2,node-name=hda,file=my_file,overlap-check=none,cache-size=16777216
  946. Example 2:
  947. ::
  948. -blockdev driver=qcow2,node-name=disk,file.driver=http,file.filename=http://example.com/image.qcow2
  949. ``Driver-specific options for other drivers``
  950. Please refer to the QAPI documentation of the ``blockdev-add``
  951. QMP command.
  952. ERST
  953. DEF("drive", HAS_ARG, QEMU_OPTION_drive,
  954. "-drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i]\n"
  955. " [,cache=writethrough|writeback|none|directsync|unsafe][,format=f]\n"
  956. " [,snapshot=on|off][,rerror=ignore|stop|report]\n"
  957. " [,werror=ignore|stop|report|enospc][,id=name][,aio=threads|native]\n"
  958. " [,readonly=on|off][,copy-on-read=on|off]\n"
  959. " [,discard=ignore|unmap][,detect-zeroes=on|off|unmap]\n"
  960. " [[,bps=b]|[[,bps_rd=r][,bps_wr=w]]]\n"
  961. " [[,iops=i]|[[,iops_rd=r][,iops_wr=w]]]\n"
  962. " [[,bps_max=bm]|[[,bps_rd_max=rm][,bps_wr_max=wm]]]\n"
  963. " [[,iops_max=im]|[[,iops_rd_max=irm][,iops_wr_max=iwm]]]\n"
  964. " [[,iops_size=is]]\n"
  965. " [[,group=g]]\n"
  966. " use 'file' as a drive image\n", QEMU_ARCH_ALL)
  967. SRST
  968. ``-drive option[,option[,option[,...]]]``
  969. Define a new drive. This includes creating a block driver node (the
  970. backend) as well as a guest device, and is mostly a shortcut for
  971. defining the corresponding ``-blockdev`` and ``-device`` options.
  972. ``-drive`` accepts all options that are accepted by ``-blockdev``.
  973. In addition, it knows the following options:
  974. ``file=file``
  975. This option defines which disk image (see
  976. :ref:`disk_005fimages`) to use with this drive. If
  977. the filename contains comma, you must double it (for instance,
  978. "file=my,,file" to use file "my,file").
  979. Special files such as iSCSI devices can be specified using
  980. protocol specific URLs. See the section for "Device URL Syntax"
  981. for more information.
  982. ``if=interface``
  983. This option defines on which type on interface the drive is
  984. connected. Available types are: ide, scsi, sd, mtd, floppy,
  985. pflash, virtio, none.
  986. ``bus=bus,unit=unit``
  987. These options define where is connected the drive by defining
  988. the bus number and the unit id.
  989. ``index=index``
  990. This option defines where is connected the drive by using an
  991. index in the list of available connectors of a given interface
  992. type.
  993. ``media=media``
  994. This option defines the type of the media: disk or cdrom.
  995. ``snapshot=snapshot``
  996. snapshot is "on" or "off" and controls snapshot mode for the
  997. given drive (see ``-snapshot``).
  998. ``cache=cache``
  999. cache is "none", "writeback", "unsafe", "directsync" or
  1000. "writethrough" and controls how the host cache is used to access
  1001. block data. This is a shortcut that sets the ``cache.direct``
  1002. and ``cache.no-flush`` options (as in ``-blockdev``), and
  1003. additionally ``cache.writeback``, which provides a default for
  1004. the ``write-cache`` option of block guest devices (as in
  1005. ``-device``). The modes correspond to the following settings:
  1006. ============= =============== ============ ==============
  1007. \ cache.writeback cache.direct cache.no-flush
  1008. ============= =============== ============ ==============
  1009. writeback on off off
  1010. none on on off
  1011. writethrough off off off
  1012. directsync off on off
  1013. unsafe on off on
  1014. ============= =============== ============ ==============
  1015. The default mode is ``cache=writeback``.
  1016. ``aio=aio``
  1017. aio is "threads", or "native" and selects between pthread based
  1018. disk I/O and native Linux AIO.
  1019. ``format=format``
  1020. Specify which disk format will be used rather than detecting the
  1021. format. Can be used to specify format=raw to avoid interpreting
  1022. an untrusted format header.
  1023. ``werror=action,rerror=action``
  1024. Specify which action to take on write and read errors. Valid
  1025. actions are: "ignore" (ignore the error and try to continue),
  1026. "stop" (pause QEMU), "report" (report the error to the guest),
  1027. "enospc" (pause QEMU only if the host disk is full; report the
  1028. error to the guest otherwise). The default setting is
  1029. ``werror=enospc`` and ``rerror=report``.
  1030. ``copy-on-read=copy-on-read``
  1031. copy-on-read is "on" or "off" and enables whether to copy read
  1032. backing file sectors into the image file.
  1033. ``bps=b,bps_rd=r,bps_wr=w``
  1034. Specify bandwidth throttling limits in bytes per second, either
  1035. for all request types or for reads or writes only. Small values
  1036. can lead to timeouts or hangs inside the guest. A safe minimum
  1037. for disks is 2 MB/s.
  1038. ``bps_max=bm,bps_rd_max=rm,bps_wr_max=wm``
  1039. Specify bursts in bytes per second, either for all request types
  1040. or for reads or writes only. Bursts allow the guest I/O to spike
  1041. above the limit temporarily.
  1042. ``iops=i,iops_rd=r,iops_wr=w``
  1043. Specify request rate limits in requests per second, either for
  1044. all request types or for reads or writes only.
  1045. ``iops_max=bm,iops_rd_max=rm,iops_wr_max=wm``
  1046. Specify bursts in requests per second, either for all request
  1047. types or for reads or writes only. Bursts allow the guest I/O to
  1048. spike above the limit temporarily.
  1049. ``iops_size=is``
  1050. Let every is bytes of a request count as a new request for iops
  1051. throttling purposes. Use this option to prevent guests from
  1052. circumventing iops limits by sending fewer but larger requests.
  1053. ``group=g``
  1054. Join a throttling quota group with given name g. All drives that
  1055. are members of the same group are accounted for together. Use
  1056. this option to prevent guests from circumventing throttling
  1057. limits by using many small disks instead of a single larger
  1058. disk.
  1059. By default, the ``cache.writeback=on`` mode is used. It will report
  1060. data writes as completed as soon as the data is present in the host
  1061. page cache. This is safe as long as your guest OS makes sure to
  1062. correctly flush disk caches where needed. If your guest OS does not
  1063. handle volatile disk write caches correctly and your host crashes or
  1064. loses power, then the guest may experience data corruption.
  1065. For such guests, you should consider using ``cache.writeback=off``.
  1066. This means that the host page cache will be used to read and write
  1067. data, but write notification will be sent to the guest only after
  1068. QEMU has made sure to flush each write to the disk. Be aware that
  1069. this has a major impact on performance.
  1070. When using the ``-snapshot`` option, unsafe caching is always used.
  1071. Copy-on-read avoids accessing the same backing file sectors
  1072. repeatedly and is useful when the backing file is over a slow
  1073. network. By default copy-on-read is off.
  1074. Instead of ``-cdrom`` you can use:
  1075. .. parsed-literal::
  1076. |qemu_system| -drive file=file,index=2,media=cdrom
  1077. Instead of ``-hda``, ``-hdb``, ``-hdc``, ``-hdd``, you can use:
  1078. .. parsed-literal::
  1079. |qemu_system| -drive file=file,index=0,media=disk
  1080. |qemu_system| -drive file=file,index=1,media=disk
  1081. |qemu_system| -drive file=file,index=2,media=disk
  1082. |qemu_system| -drive file=file,index=3,media=disk
  1083. You can open an image using pre-opened file descriptors from an fd
  1084. set:
  1085. .. parsed-literal::
  1086. |qemu_system| \
  1087. -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" \
  1088. -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" \
  1089. -drive file=/dev/fdset/2,index=0,media=disk
  1090. You can connect a CDROM to the slave of ide0:
  1091. .. parsed-literal::
  1092. |qemu_system_x86| -drive file=file,if=ide,index=1,media=cdrom
  1093. If you don't specify the "file=" argument, you define an empty
  1094. drive:
  1095. .. parsed-literal::
  1096. |qemu_system_x86| -drive if=ide,index=1,media=cdrom
  1097. Instead of ``-fda``, ``-fdb``, you can use:
  1098. .. parsed-literal::
  1099. |qemu_system_x86| -drive file=file,index=0,if=floppy
  1100. |qemu_system_x86| -drive file=file,index=1,if=floppy
  1101. By default, interface is "ide" and index is automatically
  1102. incremented:
  1103. .. parsed-literal::
  1104. |qemu_system_x86| -drive file=a -drive file=b"
  1105. is interpreted like:
  1106. .. parsed-literal::
  1107. |qemu_system_x86| -hda a -hdb b
  1108. ERST
  1109. DEF("mtdblock", HAS_ARG, QEMU_OPTION_mtdblock,
  1110. "-mtdblock file use 'file' as on-board Flash memory image\n",
  1111. QEMU_ARCH_ALL)
  1112. SRST
  1113. ``-mtdblock file``
  1114. Use file as on-board Flash memory image.
  1115. ERST
  1116. DEF("sd", HAS_ARG, QEMU_OPTION_sd,
  1117. "-sd file use 'file' as SecureDigital card image\n", QEMU_ARCH_ALL)
  1118. SRST
  1119. ``-sd file``
  1120. Use file as SecureDigital card image.
  1121. ERST
  1122. DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
  1123. "-pflash file use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
  1124. SRST
  1125. ``-pflash file``
  1126. Use file as a parallel flash image.
  1127. ERST
  1128. DEF("snapshot", 0, QEMU_OPTION_snapshot,
  1129. "-snapshot write to temporary files instead of disk image files\n",
  1130. QEMU_ARCH_ALL)
  1131. SRST
  1132. ``-snapshot``
  1133. Write to temporary files instead of disk image files. In this case,
  1134. the raw disk image you use is not written back. You can however
  1135. force the write back by pressing C-a s (see
  1136. :ref:`disk_005fimages`).
  1137. ERST
  1138. DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,
  1139. "-fsdev local,id=id,path=path,security_model=mapped-xattr|mapped-file|passthrough|none\n"
  1140. " [,writeout=immediate][,readonly][,fmode=fmode][,dmode=dmode]\n"
  1141. " [[,throttling.bps-total=b]|[[,throttling.bps-read=r][,throttling.bps-write=w]]]\n"
  1142. " [[,throttling.iops-total=i]|[[,throttling.iops-read=r][,throttling.iops-write=w]]]\n"
  1143. " [[,throttling.bps-total-max=bm]|[[,throttling.bps-read-max=rm][,throttling.bps-write-max=wm]]]\n"
  1144. " [[,throttling.iops-total-max=im]|[[,throttling.iops-read-max=irm][,throttling.iops-write-max=iwm]]]\n"
  1145. " [[,throttling.iops-size=is]]\n"
  1146. "-fsdev proxy,id=id,socket=socket[,writeout=immediate][,readonly]\n"
  1147. "-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=immediate][,readonly]\n"
  1148. "-fsdev synth,id=id\n",
  1149. QEMU_ARCH_ALL)
  1150. SRST
  1151. ``-fsdev local,id=id,path=path,security_model=security_model [,writeout=writeout][,readonly][,fmode=fmode][,dmode=dmode] [,throttling.option=value[,throttling.option=value[,...]]]``
  1152. \
  1153. ``-fsdev proxy,id=id,socket=socket[,writeout=writeout][,readonly]``
  1154. \
  1155. ``-fsdev proxy,id=id,sock_fd=sock_fd[,writeout=writeout][,readonly]``
  1156. \
  1157. ``-fsdev synth,id=id[,readonly]``
  1158. Define a new file system device. Valid options are:
  1159. ``local``
  1160. Accesses to the filesystem are done by QEMU.
  1161. ``proxy``
  1162. Accesses to the filesystem are done by virtfs-proxy-helper(1).
  1163. ``synth``
  1164. Synthetic filesystem, only used by QTests.
  1165. ``id=id``
  1166. Specifies identifier for this device.
  1167. ``path=path``
  1168. Specifies the export path for the file system device. Files
  1169. under this path will be available to the 9p client on the guest.
  1170. ``security_model=security_model``
  1171. Specifies the security model to be used for this export path.
  1172. Supported security models are "passthrough", "mapped-xattr",
  1173. "mapped-file" and "none". In "passthrough" security model, files
  1174. are stored using the same credentials as they are created on the
  1175. guest. This requires QEMU to run as root. In "mapped-xattr"
  1176. security model, some of the file attributes like uid, gid, mode
  1177. bits and link target are stored as file attributes. For
  1178. "mapped-file" these attributes are stored in the hidden
  1179. .virtfs\_metadata directory. Directories exported by this
  1180. security model cannot interact with other unix tools. "none"
  1181. security model is same as passthrough except the sever won't
  1182. report failures if it fails to set file attributes like
  1183. ownership. Security model is mandatory only for local fsdriver.
  1184. Other fsdrivers (like proxy) don't take security model as a
  1185. parameter.
  1186. ``writeout=writeout``
  1187. This is an optional argument. The only supported value is
  1188. "immediate". This means that host page cache will be used to
  1189. read and write data but write notification will be sent to the
  1190. guest only when the data has been reported as written by the
  1191. storage subsystem.
  1192. ``readonly``
  1193. Enables exporting 9p share as a readonly mount for guests. By
  1194. default read-write access is given.
  1195. ``socket=socket``
  1196. Enables proxy filesystem driver to use passed socket file for
  1197. communicating with virtfs-proxy-helper(1).
  1198. ``sock_fd=sock_fd``
  1199. Enables proxy filesystem driver to use passed socket descriptor
  1200. for communicating with virtfs-proxy-helper(1). Usually a helper
  1201. like libvirt will create socketpair and pass one of the fds as
  1202. sock\_fd.
  1203. ``fmode=fmode``
  1204. Specifies the default mode for newly created files on the host.
  1205. Works only with security models "mapped-xattr" and
  1206. "mapped-file".
  1207. ``dmode=dmode``
  1208. Specifies the default mode for newly created directories on the
  1209. host. Works only with security models "mapped-xattr" and
  1210. "mapped-file".
  1211. ``throttling.bps-total=b,throttling.bps-read=r,throttling.bps-write=w``
  1212. Specify bandwidth throttling limits in bytes per second, either
  1213. for all request types or for reads or writes only.
  1214. ``throttling.bps-total-max=bm,bps-read-max=rm,bps-write-max=wm``
  1215. Specify bursts in bytes per second, either for all request types
  1216. or for reads or writes only. Bursts allow the guest I/O to spike
  1217. above the limit temporarily.
  1218. ``throttling.iops-total=i,throttling.iops-read=r, throttling.iops-write=w``
  1219. Specify request rate limits in requests per second, either for
  1220. all request types or for reads or writes only.
  1221. ``throttling.iops-total-max=im,throttling.iops-read-max=irm, throttling.iops-write-max=iwm``
  1222. Specify bursts in requests per second, either for all request
  1223. types or for reads or writes only. Bursts allow the guest I/O to
  1224. spike above the limit temporarily.
  1225. ``throttling.iops-size=is``
  1226. Let every is bytes of a request count as a new request for iops
  1227. throttling purposes.
  1228. -fsdev option is used along with -device driver "virtio-9p-...".
  1229. ``-device virtio-9p-type,fsdev=id,mount_tag=mount_tag``
  1230. Options for virtio-9p-... driver are:
  1231. ``type``
  1232. Specifies the variant to be used. Supported values are "pci",
  1233. "ccw" or "device", depending on the machine type.
  1234. ``fsdev=id``
  1235. Specifies the id value specified along with -fsdev option.
  1236. ``mount_tag=mount_tag``
  1237. Specifies the tag name to be used by the guest to mount this
  1238. export point.
  1239. ERST
  1240. DEF("virtfs", HAS_ARG, QEMU_OPTION_virtfs,
  1241. "-virtfs local,path=path,mount_tag=tag,security_model=mapped-xattr|mapped-file|passthrough|none\n"
  1242. " [,id=id][,writeout=immediate][,readonly][,fmode=fmode][,dmode=dmode][,multidevs=remap|forbid|warn]\n"
  1243. "-virtfs proxy,mount_tag=tag,socket=socket[,id=id][,writeout=immediate][,readonly]\n"
  1244. "-virtfs proxy,mount_tag=tag,sock_fd=sock_fd[,id=id][,writeout=immediate][,readonly]\n"
  1245. "-virtfs synth,mount_tag=tag[,id=id][,readonly]\n",
  1246. QEMU_ARCH_ALL)
  1247. SRST
  1248. ``-virtfs local,path=path,mount_tag=mount_tag ,security_model=security_model[,writeout=writeout][,readonly] [,fmode=fmode][,dmode=dmode][,multidevs=multidevs]``
  1249. \
  1250. ``-virtfs proxy,socket=socket,mount_tag=mount_tag [,writeout=writeout][,readonly]``
  1251. \
  1252. ``-virtfs proxy,sock_fd=sock_fd,mount_tag=mount_tag [,writeout=writeout][,readonly]``
  1253. \
  1254. ``-virtfs synth,mount_tag=mount_tag``
  1255. Define a new virtual filesystem device and expose it to the guest using
  1256. a virtio-9p-device (a.k.a. 9pfs), which essentially means that a certain
  1257. directory on host is made directly accessible by guest as a pass-through
  1258. file system by using the 9P network protocol for communication between
  1259. host and guests, if desired even accessible, shared by several guests
  1260. simultaniously.
  1261. Note that ``-virtfs`` is actually just a convenience shortcut for its
  1262. generalized form ``-fsdev -device virtio-9p-pci``.
  1263. The general form of pass-through file system options are:
  1264. ``local``
  1265. Accesses to the filesystem are done by QEMU.
  1266. ``proxy``
  1267. Accesses to the filesystem are done by virtfs-proxy-helper(1).
  1268. ``synth``
  1269. Synthetic filesystem, only used by QTests.
  1270. ``id=id``
  1271. Specifies identifier for the filesystem device
  1272. ``path=path``
  1273. Specifies the export path for the file system device. Files
  1274. under this path will be available to the 9p client on the guest.
  1275. ``security_model=security_model``
  1276. Specifies the security model to be used for this export path.
  1277. Supported security models are "passthrough", "mapped-xattr",
  1278. "mapped-file" and "none". In "passthrough" security model, files
  1279. are stored using the same credentials as they are created on the
  1280. guest. This requires QEMU to run as root. In "mapped-xattr"
  1281. security model, some of the file attributes like uid, gid, mode
  1282. bits and link target are stored as file attributes. For
  1283. "mapped-file" these attributes are stored in the hidden
  1284. .virtfs\_metadata directory. Directories exported by this
  1285. security model cannot interact with other unix tools. "none"
  1286. security model is same as passthrough except the sever won't
  1287. report failures if it fails to set file attributes like
  1288. ownership. Security model is mandatory only for local fsdriver.
  1289. Other fsdrivers (like proxy) don't take security model as a
  1290. parameter.
  1291. ``writeout=writeout``
  1292. This is an optional argument. The only supported value is
  1293. "immediate". This means that host page cache will be used to
  1294. read and write data but write notification will be sent to the
  1295. guest only when the data has been reported as written by the
  1296. storage subsystem.
  1297. ``readonly``
  1298. Enables exporting 9p share as a readonly mount for guests. By
  1299. default read-write access is given.
  1300. ``socket=socket``
  1301. Enables proxy filesystem driver to use passed socket file for
  1302. communicating with virtfs-proxy-helper(1). Usually a helper like
  1303. libvirt will create socketpair and pass one of the fds as
  1304. sock\_fd.
  1305. ``sock_fd``
  1306. Enables proxy filesystem driver to use passed 'sock\_fd' as the
  1307. socket descriptor for interfacing with virtfs-proxy-helper(1).
  1308. ``fmode=fmode``
  1309. Specifies the default mode for newly created files on the host.
  1310. Works only with security models "mapped-xattr" and
  1311. "mapped-file".
  1312. ``dmode=dmode``
  1313. Specifies the default mode for newly created directories on the
  1314. host. Works only with security models "mapped-xattr" and
  1315. "mapped-file".
  1316. ``mount_tag=mount_tag``
  1317. Specifies the tag name to be used by the guest to mount this
  1318. export point.
  1319. ``multidevs=multidevs``
  1320. Specifies how to deal with multiple devices being shared with a
  1321. 9p export. Supported behaviours are either "remap", "forbid" or
  1322. "warn". The latter is the default behaviour on which virtfs 9p
  1323. expects only one device to be shared with the same export, and
  1324. if more than one device is shared and accessed via the same 9p
  1325. export then only a warning message is logged (once) by qemu on
  1326. host side. In order to avoid file ID collisions on guest you
  1327. should either create a separate virtfs export for each device to
  1328. be shared with guests (recommended way) or you might use "remap"
  1329. instead which allows you to share multiple devices with only one
  1330. export instead, which is achieved by remapping the original
  1331. inode numbers from host to guest in a way that would prevent
  1332. such collisions. Remapping inodes in such use cases is required
  1333. because the original device IDs from host are never passed and
  1334. exposed on guest. Instead all files of an export shared with
  1335. virtfs always share the same device id on guest. So two files
  1336. with identical inode numbers but from actually different devices
  1337. on host would otherwise cause a file ID collision and hence
  1338. potential misbehaviours on guest. "forbid" on the other hand
  1339. assumes like "warn" that only one device is shared by the same
  1340. export, however it will not only log a warning message but also
  1341. deny access to additional devices on guest. Note though that
  1342. "forbid" does currently not block all possible file access
  1343. operations (e.g. readdir() would still return entries from other
  1344. devices).
  1345. ERST
  1346. DEF("iscsi", HAS_ARG, QEMU_OPTION_iscsi,
  1347. "-iscsi [user=user][,password=password]\n"
  1348. " [,header-digest=CRC32C|CR32C-NONE|NONE-CRC32C|NONE\n"
  1349. " [,initiator-name=initiator-iqn][,id=target-iqn]\n"
  1350. " [,timeout=timeout]\n"
  1351. " iSCSI session parameters\n", QEMU_ARCH_ALL)
  1352. SRST
  1353. ``-iscsi``
  1354. Configure iSCSI session parameters.
  1355. ERST
  1356. DEFHEADING()
  1357. DEFHEADING(USB options:)
  1358. DEF("usb", 0, QEMU_OPTION_usb,
  1359. "-usb enable on-board USB host controller (if not enabled by default)\n",
  1360. QEMU_ARCH_ALL)
  1361. SRST
  1362. ``-usb``
  1363. Enable USB emulation on machine types with an on-board USB host
  1364. controller (if not enabled by default). Note that on-board USB host
  1365. controllers may not support USB 3.0. In this case
  1366. ``-device qemu-xhci`` can be used instead on machines with PCI.
  1367. ERST
  1368. DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice,
  1369. "-usbdevice name add the host or guest USB device 'name'\n",
  1370. QEMU_ARCH_ALL)
  1371. SRST
  1372. ``-usbdevice devname``
  1373. Add the USB device devname. Note that this option is deprecated,
  1374. please use ``-device usb-...`` instead. See
  1375. :ref:`usb_005fdevices`.
  1376. ``mouse``
  1377. Virtual Mouse. This will override the PS/2 mouse emulation when
  1378. activated.
  1379. ``tablet``
  1380. Pointer device that uses absolute coordinates (like a
  1381. touchscreen). This means QEMU is able to report the mouse
  1382. position without having to grab the mouse. Also overrides the
  1383. PS/2 mouse emulation when activated.
  1384. ``braille``
  1385. Braille device. This will use BrlAPI to display the braille
  1386. output on a real or fake device.
  1387. ERST
  1388. DEFHEADING()
  1389. DEFHEADING(Display options:)
  1390. DEF("display", HAS_ARG, QEMU_OPTION_display,
  1391. #if defined(CONFIG_SPICE)
  1392. "-display spice-app[,gl=on|off]\n"
  1393. #endif
  1394. #if defined(CONFIG_SDL)
  1395. "-display sdl[,alt_grab=on|off][,ctrl_grab=on|off]\n"
  1396. " [,window_close=on|off][,gl=on|core|es|off]\n"
  1397. #endif
  1398. #if defined(CONFIG_GTK)
  1399. "-display gtk[,grab_on_hover=on|off][,gl=on|off]|\n"
  1400. #endif
  1401. #if defined(CONFIG_VNC)
  1402. "-display vnc=<display>[,<optargs>]\n"
  1403. #endif
  1404. #if defined(CONFIG_CURSES)
  1405. "-display curses[,charset=<encoding>]\n"
  1406. #endif
  1407. #if defined(CONFIG_OPENGL)
  1408. "-display egl-headless[,rendernode=<file>]\n"
  1409. #endif
  1410. "-display none\n"
  1411. " select display backend type\n"
  1412. " The default display is equivalent to\n "
  1413. #if defined(CONFIG_GTK)
  1414. "\"-display gtk\"\n"
  1415. #elif defined(CONFIG_SDL)
  1416. "\"-display sdl\"\n"
  1417. #elif defined(CONFIG_COCOA)
  1418. "\"-display cocoa\"\n"
  1419. #elif defined(CONFIG_VNC)
  1420. "\"-vnc localhost:0,to=99,id=default\"\n"
  1421. #else
  1422. "\"-display none\"\n"
  1423. #endif
  1424. , QEMU_ARCH_ALL)
  1425. SRST
  1426. ``-display type``
  1427. Select type of display to use. This option is a replacement for the
  1428. old style -sdl/-curses/... options. Use ``-display help`` to list
  1429. the available display types. Valid values for type are
  1430. ``sdl``
  1431. Display video output via SDL (usually in a separate graphics
  1432. window; see the SDL documentation for other possibilities).
  1433. ``curses``
  1434. Display video output via curses. For graphics device models
  1435. which support a text mode, QEMU can display this output using a
  1436. curses/ncurses interface. Nothing is displayed when the graphics
  1437. device is in graphical mode or if the graphics device does not
  1438. support a text mode. Generally only the VGA device models
  1439. support text mode. The font charset used by the guest can be
  1440. specified with the ``charset`` option, for example
  1441. ``charset=CP850`` for IBM CP850 encoding. The default is
  1442. ``CP437``.
  1443. ``none``
  1444. Do not display video output. The guest will still see an
  1445. emulated graphics card, but its output will not be displayed to
  1446. the QEMU user. This option differs from the -nographic option in
  1447. that it only affects what is done with video output; -nographic
  1448. also changes the destination of the serial and parallel port
  1449. data.
  1450. ``gtk``
  1451. Display video output in a GTK window. This interface provides
  1452. drop-down menus and other UI elements to configure and control
  1453. the VM during runtime.
  1454. ``vnc``
  1455. Start a VNC server on display <arg>
  1456. ``egl-headless``
  1457. Offload all OpenGL operations to a local DRI device. For any
  1458. graphical display, this display needs to be paired with either
  1459. VNC or SPICE displays.
  1460. ``spice-app``
  1461. Start QEMU as a Spice server and launch the default Spice client
  1462. application. The Spice server will redirect the serial consoles
  1463. and QEMU monitors. (Since 4.0)
  1464. ERST
  1465. DEF("nographic", 0, QEMU_OPTION_nographic,
  1466. "-nographic disable graphical output and redirect serial I/Os to console\n",
  1467. QEMU_ARCH_ALL)
  1468. SRST
  1469. ``-nographic``
  1470. Normally, if QEMU is compiled with graphical window support, it
  1471. displays output such as guest graphics, guest console, and the QEMU
  1472. monitor in a window. With this option, you can totally disable
  1473. graphical output so that QEMU is a simple command line application.
  1474. The emulated serial port is redirected on the console and muxed with
  1475. the monitor (unless redirected elsewhere explicitly). Therefore, you
  1476. can still use QEMU to debug a Linux kernel with a serial console.
  1477. Use C-a h for help on switching between the console and monitor.
  1478. ERST
  1479. DEF("curses", 0, QEMU_OPTION_curses,
  1480. "-curses shorthand for -display curses\n",
  1481. QEMU_ARCH_ALL)
  1482. SRST
  1483. ``-curses``
  1484. Normally, if QEMU is compiled with graphical window support, it
  1485. displays output such as guest graphics, guest console, and the QEMU
  1486. monitor in a window. With this option, QEMU can display the VGA
  1487. output when in text mode using a curses/ncurses interface. Nothing
  1488. is displayed in graphical mode.
  1489. ERST
  1490. DEF("alt-grab", 0, QEMU_OPTION_alt_grab,
  1491. "-alt-grab use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n",
  1492. QEMU_ARCH_ALL)
  1493. SRST
  1494. ``-alt-grab``
  1495. Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that
  1496. this also affects the special keys (for fullscreen, monitor-mode
  1497. switching, etc).
  1498. ERST
  1499. DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
  1500. "-ctrl-grab use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n",
  1501. QEMU_ARCH_ALL)
  1502. SRST
  1503. ``-ctrl-grab``
  1504. Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this
  1505. also affects the special keys (for fullscreen, monitor-mode
  1506. switching, etc).
  1507. ERST
  1508. DEF("no-quit", 0, QEMU_OPTION_no_quit,
  1509. "-no-quit disable SDL window close capability\n", QEMU_ARCH_ALL)
  1510. SRST
  1511. ``-no-quit``
  1512. Disable SDL window close capability.
  1513. ERST
  1514. DEF("sdl", 0, QEMU_OPTION_sdl,
  1515. "-sdl shorthand for -display sdl\n", QEMU_ARCH_ALL)
  1516. SRST
  1517. ``-sdl``
  1518. Enable SDL.
  1519. ERST
  1520. DEF("spice", HAS_ARG, QEMU_OPTION_spice,
  1521. "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
  1522. " [,x509-key-file=<file>][,x509-key-password=<file>]\n"
  1523. " [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n"
  1524. " [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6|unix]\n"
  1525. " [,tls-ciphers=<list>]\n"
  1526. " [,tls-channel=[main|display|cursor|inputs|record|playback]]\n"
  1527. " [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n"
  1528. " [,sasl][,password=<secret>][,disable-ticketing]\n"
  1529. " [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n"
  1530. " [,jpeg-wan-compression=[auto|never|always]]\n"
  1531. " [,zlib-glz-wan-compression=[auto|never|always]]\n"
  1532. " [,streaming-video=[off|all|filter]][,disable-copy-paste]\n"
  1533. " [,disable-agent-file-xfer][,agent-mouse=[on|off]]\n"
  1534. " [,playback-compression=[on|off]][,seamless-migration=[on|off]]\n"
  1535. " [,gl=[on|off]][,rendernode=<file>]\n"
  1536. " enable spice\n"
  1537. " at least one of {port, tls-port} is mandatory\n",
  1538. QEMU_ARCH_ALL)
  1539. SRST
  1540. ``-spice option[,option[,...]]``
  1541. Enable the spice remote desktop protocol. Valid options are
  1542. ``port=<nr>``
  1543. Set the TCP port spice is listening on for plaintext channels.
  1544. ``addr=<addr>``
  1545. Set the IP address spice is listening on. Default is any
  1546. address.
  1547. ``ipv4``; \ ``ipv6``; \ ``unix``
  1548. Force using the specified IP version.
  1549. ``password=<secret>``
  1550. Set the password you need to authenticate.
  1551. ``sasl``
  1552. Require that the client use SASL to authenticate with the spice.
  1553. The exact choice of authentication method used is controlled
  1554. from the system / user's SASL configuration file for the 'qemu'
  1555. service. This is typically found in /etc/sasl2/qemu.conf. If
  1556. running QEMU as an unprivileged user, an environment variable
  1557. SASL\_CONF\_PATH can be used to make it search alternate
  1558. locations for the service config. While some SASL auth methods
  1559. can also provide data encryption (eg GSSAPI), it is recommended
  1560. that SASL always be combined with the 'tls' and 'x509' settings
  1561. to enable use of SSL and server certificates. This ensures a
  1562. data encryption preventing compromise of authentication
  1563. credentials.
  1564. ``disable-ticketing``
  1565. Allow client connects without authentication.
  1566. ``disable-copy-paste``
  1567. Disable copy paste between the client and the guest.
  1568. ``disable-agent-file-xfer``
  1569. Disable spice-vdagent based file-xfer between the client and the
  1570. guest.
  1571. ``tls-port=<nr>``
  1572. Set the TCP port spice is listening on for encrypted channels.
  1573. ``x509-dir=<dir>``
  1574. Set the x509 file directory. Expects same filenames as -vnc
  1575. $display,x509=$dir
  1576. ``x509-key-file=<file>``; \ ``x509-key-password=<file>``; \ ``x509-cert-file=<file>``; \ ``x509-cacert-file=<file>``; \ ``x509-dh-key-file=<file>``
  1577. The x509 file names can also be configured individually.
  1578. ``tls-ciphers=<list>``
  1579. Specify which ciphers to use.
  1580. ``tls-channel=[main|display|cursor|inputs|record|playback]``; \ ``plaintext-channel=[main|display|cursor|inputs|record|playback]``
  1581. Force specific channel to be used with or without TLS
  1582. encryption. The options can be specified multiple times to
  1583. configure multiple channels. The special name "default" can be
  1584. used to set the default mode. For channels which are not
  1585. explicitly forced into one mode the spice client is allowed to
  1586. pick tls/plaintext as he pleases.
  1587. ``image-compression=[auto_glz|auto_lz|quic|glz|lz|off]``
  1588. Configure image compression (lossless). Default is auto\_glz.
  1589. ``jpeg-wan-compression=[auto|never|always]``; \ ``zlib-glz-wan-compression=[auto|never|always]``
  1590. Configure wan image compression (lossy for slow links). Default
  1591. is auto.
  1592. ``streaming-video=[off|all|filter]``
  1593. Configure video stream detection. Default is off.
  1594. ``agent-mouse=[on|off]``
  1595. Enable/disable passing mouse events via vdagent. Default is on.
  1596. ``playback-compression=[on|off]``
  1597. Enable/disable audio stream compression (using celt 0.5.1).
  1598. Default is on.
  1599. ``seamless-migration=[on|off]``
  1600. Enable/disable spice seamless migration. Default is off.
  1601. ``gl=[on|off]``
  1602. Enable/disable OpenGL context. Default is off.
  1603. ``rendernode=<file>``
  1604. DRM render node for OpenGL rendering. If not specified, it will
  1605. pick the first available. (Since 2.9)
  1606. ERST
  1607. DEF("portrait", 0, QEMU_OPTION_portrait,
  1608. "-portrait rotate graphical output 90 deg left (only PXA LCD)\n",
  1609. QEMU_ARCH_ALL)
  1610. SRST
  1611. ``-portrait``
  1612. Rotate graphical output 90 deg left (only PXA LCD).
  1613. ERST
  1614. DEF("rotate", HAS_ARG, QEMU_OPTION_rotate,
  1615. "-rotate <deg> rotate graphical output some deg left (only PXA LCD)\n",
  1616. QEMU_ARCH_ALL)
  1617. SRST
  1618. ``-rotate deg``
  1619. Rotate graphical output some deg left (only PXA LCD).
  1620. ERST
  1621. DEF("vga", HAS_ARG, QEMU_OPTION_vga,
  1622. "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n"
  1623. " select video card type\n", QEMU_ARCH_ALL)
  1624. SRST
  1625. ``-vga type``
  1626. Select type of VGA card to emulate. Valid values for type are
  1627. ``cirrus``
  1628. Cirrus Logic GD5446 Video card. All Windows versions starting
  1629. from Windows 95 should recognize and use this graphic card. For
  1630. optimal performances, use 16 bit color depth in the guest and
  1631. the host OS. (This card was the default before QEMU 2.2)
  1632. ``std``
  1633. Standard VGA card with Bochs VBE extensions. If your guest OS
  1634. supports the VESA 2.0 VBE extensions (e.g. Windows XP) and if
  1635. you want to use high resolution modes (>= 1280x1024x16) then you
  1636. should use this option. (This card is the default since QEMU
  1637. 2.2)
  1638. ``vmware``
  1639. VMWare SVGA-II compatible adapter. Use it if you have
  1640. sufficiently recent XFree86/XOrg server or Windows guest with a
  1641. driver for this card.
  1642. ``qxl``
  1643. QXL paravirtual graphic card. It is VGA compatible (including
  1644. VESA 2.0 VBE support). Works best with qxl guest drivers
  1645. installed though. Recommended choice when using the spice
  1646. protocol.
  1647. ``tcx``
  1648. (sun4m only) Sun TCX framebuffer. This is the default
  1649. framebuffer for sun4m machines and offers both 8-bit and 24-bit
  1650. colour depths at a fixed resolution of 1024x768.
  1651. ``cg3``
  1652. (sun4m only) Sun cgthree framebuffer. This is a simple 8-bit
  1653. framebuffer for sun4m machines available in both 1024x768
  1654. (OpenBIOS) and 1152x900 (OBP) resolutions aimed at people
  1655. wishing to run older Solaris versions.
  1656. ``virtio``
  1657. Virtio VGA card.
  1658. ``none``
  1659. Disable VGA card.
  1660. ERST
  1661. DEF("full-screen", 0, QEMU_OPTION_full_screen,
  1662. "-full-screen start in full screen\n", QEMU_ARCH_ALL)
  1663. SRST
  1664. ``-full-screen``
  1665. Start in full screen.
  1666. ERST
  1667. DEF("g", HAS_ARG, QEMU_OPTION_g ,
  1668. "-g WxH[xDEPTH] Set the initial graphical resolution and depth\n",
  1669. QEMU_ARCH_PPC | QEMU_ARCH_SPARC | QEMU_ARCH_M68K)
  1670. SRST
  1671. ``-g`` *width*\ ``x``\ *height*\ ``[x``\ *depth*\ ``]``
  1672. Set the initial graphical resolution and depth (PPC, SPARC only).
  1673. For PPC the default is 800x600x32.
  1674. For SPARC with the TCX graphics device, the default is 1024x768x8
  1675. with the option of 1024x768x24. For cgthree, the default is
  1676. 1024x768x8 with the option of 1152x900x8 for people who wish to use
  1677. OBP.
  1678. ERST
  1679. DEF("vnc", HAS_ARG, QEMU_OPTION_vnc ,
  1680. "-vnc <display> shorthand for -display vnc=<display>\n", QEMU_ARCH_ALL)
  1681. SRST
  1682. ``-vnc display[,option[,option[,...]]]``
  1683. Normally, if QEMU is compiled with graphical window support, it
  1684. displays output such as guest graphics, guest console, and the QEMU
  1685. monitor in a window. With this option, you can have QEMU listen on
  1686. VNC display display and redirect the VGA display over the VNC
  1687. session. It is very useful to enable the usb tablet device when
  1688. using this option (option ``-device usb-tablet``). When using the
  1689. VNC display, you must use the ``-k`` parameter to set the keyboard
  1690. layout if you are not using en-us. Valid syntax for the display is
  1691. ``to=L``
  1692. With this option, QEMU will try next available VNC displays,
  1693. until the number L, if the origianlly defined "-vnc display" is
  1694. not available, e.g. port 5900+display is already used by another
  1695. application. By default, to=0.
  1696. ``host:d``
  1697. TCP connections will only be allowed from host on display d. By
  1698. convention the TCP port is 5900+d. Optionally, host can be
  1699. omitted in which case the server will accept connections from
  1700. any host.
  1701. ``unix:path``
  1702. Connections will be allowed over UNIX domain sockets where path
  1703. is the location of a unix socket to listen for connections on.
  1704. ``none``
  1705. VNC is initialized but not started. The monitor ``change``
  1706. command can be used to later start the VNC server.
  1707. Following the display value there may be one or more option flags
  1708. separated by commas. Valid options are
  1709. ``reverse``
  1710. Connect to a listening VNC client via a "reverse" connection.
  1711. The client is specified by the display. For reverse network
  1712. connections (host:d,``reverse``), the d argument is a TCP port
  1713. number, not a display number.
  1714. ``websocket``
  1715. Opens an additional TCP listening port dedicated to VNC
  1716. Websocket connections. If a bare websocket option is given, the
  1717. Websocket port is 5700+display. An alternative port can be
  1718. specified with the syntax ``websocket``\ =port.
  1719. If host is specified connections will only be allowed from this
  1720. host. It is possible to control the websocket listen address
  1721. independently, using the syntax ``websocket``\ =host:port.
  1722. If no TLS credentials are provided, the websocket connection
  1723. runs in unencrypted mode. If TLS credentials are provided, the
  1724. websocket connection requires encrypted client connections.
  1725. ``password``
  1726. Require that password based authentication is used for client
  1727. connections.
  1728. The password must be set separately using the ``set_password``
  1729. command in the :ref:`pcsys_005fmonitor`. The
  1730. syntax to change your password is:
  1731. ``set_password <protocol> <password>`` where <protocol> could be
  1732. either "vnc" or "spice".
  1733. If you would like to change <protocol> password expiration, you
  1734. should use ``expire_password <protocol> <expiration-time>``
  1735. where expiration time could be one of the following options:
  1736. now, never, +seconds or UNIX time of expiration, e.g. +60 to
  1737. make password expire in 60 seconds, or 1335196800 to make
  1738. password expire on "Mon Apr 23 12:00:00 EDT 2012" (UNIX time for
  1739. this date and time).
  1740. You can also use keywords "now" or "never" for the expiration
  1741. time to allow <protocol> password to expire immediately or never
  1742. expire.
  1743. ``tls-creds=ID``
  1744. Provides the ID of a set of TLS credentials to use to secure the
  1745. VNC server. They will apply to both the normal VNC server socket
  1746. and the websocket socket (if enabled). Setting TLS credentials
  1747. will cause the VNC server socket to enable the VeNCrypt auth
  1748. mechanism. The credentials should have been previously created
  1749. using the ``-object tls-creds`` argument.
  1750. ``tls-authz=ID``
  1751. Provides the ID of the QAuthZ authorization object against which
  1752. the client's x509 distinguished name will validated. This object
  1753. is only resolved at time of use, so can be deleted and recreated
  1754. on the fly while the VNC server is active. If missing, it will
  1755. default to denying access.
  1756. ``sasl``
  1757. Require that the client use SASL to authenticate with the VNC
  1758. server. The exact choice of authentication method used is
  1759. controlled from the system / user's SASL configuration file for
  1760. the 'qemu' service. This is typically found in
  1761. /etc/sasl2/qemu.conf. If running QEMU as an unprivileged user,
  1762. an environment variable SASL\_CONF\_PATH can be used to make it
  1763. search alternate locations for the service config. While some
  1764. SASL auth methods can also provide data encryption (eg GSSAPI),
  1765. it is recommended that SASL always be combined with the 'tls'
  1766. and 'x509' settings to enable use of SSL and server
  1767. certificates. This ensures a data encryption preventing
  1768. compromise of authentication credentials. See the
  1769. :ref:`vnc_005fsecurity` section for details on
  1770. using SASL authentication.
  1771. ``sasl-authz=ID``
  1772. Provides the ID of the QAuthZ authorization object against which
  1773. the client's SASL username will validated. This object is only
  1774. resolved at time of use, so can be deleted and recreated on the
  1775. fly while the VNC server is active. If missing, it will default
  1776. to denying access.
  1777. ``acl``
  1778. Legacy method for enabling authorization of clients against the
  1779. x509 distinguished name and SASL username. It results in the
  1780. creation of two ``authz-list`` objects with IDs of
  1781. ``vnc.username`` and ``vnc.x509dname``. The rules for these
  1782. objects must be configured with the HMP ACL commands.
  1783. This option is deprecated and should no longer be used. The new
  1784. ``sasl-authz`` and ``tls-authz`` options are a replacement.
  1785. ``lossy``
  1786. Enable lossy compression methods (gradient, JPEG, ...). If this
  1787. option is set, VNC client may receive lossy framebuffer updates
  1788. depending on its encoding settings. Enabling this option can
  1789. save a lot of bandwidth at the expense of quality.
  1790. ``non-adaptive``
  1791. Disable adaptive encodings. Adaptive encodings are enabled by
  1792. default. An adaptive encoding will try to detect frequently
  1793. updated screen regions, and send updates in these regions using
  1794. a lossy encoding (like JPEG). This can be really helpful to save
  1795. bandwidth when playing videos. Disabling adaptive encodings
  1796. restores the original static behavior of encodings like Tight.
  1797. ``share=[allow-exclusive|force-shared|ignore]``
  1798. Set display sharing policy. 'allow-exclusive' allows clients to
  1799. ask for exclusive access. As suggested by the rfb spec this is
  1800. implemented by dropping other connections. Connecting multiple
  1801. clients in parallel requires all clients asking for a shared
  1802. session (vncviewer: -shared switch). This is the default.
  1803. 'force-shared' disables exclusive client access. Useful for
  1804. shared desktop sessions, where you don't want someone forgetting
  1805. specify -shared disconnect everybody else. 'ignore' completely
  1806. ignores the shared flag and allows everybody connect
  1807. unconditionally. Doesn't conform to the rfb spec but is
  1808. traditional QEMU behavior.
  1809. ``key-delay-ms``
  1810. Set keyboard delay, for key down and key up events, in
  1811. milliseconds. Default is 10. Keyboards are low-bandwidth
  1812. devices, so this slowdown can help the device and guest to keep
  1813. up and not lose events in case events are arriving in bulk.
  1814. Possible causes for the latter are flaky network connections, or
  1815. scripts for automated testing.
  1816. ``audiodev=audiodev``
  1817. Use the specified audiodev when the VNC client requests audio
  1818. transmission. When not using an -audiodev argument, this option
  1819. must be omitted, otherwise is must be present and specify a
  1820. valid audiodev.
  1821. ERST
  1822. ARCHHEADING(, QEMU_ARCH_I386)
  1823. ARCHHEADING(i386 target only:, QEMU_ARCH_I386)
  1824. DEF("win2k-hack", 0, QEMU_OPTION_win2k_hack,
  1825. "-win2k-hack use it when installing Windows 2000 to avoid a disk full bug\n",
  1826. QEMU_ARCH_I386)
  1827. SRST
  1828. ``-win2k-hack``
  1829. Use it when installing Windows 2000 to avoid a disk full bug. After
  1830. Windows 2000 is installed, you no longer need this option (this
  1831. option slows down the IDE transfers).
  1832. ERST
  1833. DEF("no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk,
  1834. "-no-fd-bootchk disable boot signature checking for floppy disks\n",
  1835. QEMU_ARCH_I386)
  1836. SRST
  1837. ``-no-fd-bootchk``
  1838. Disable boot signature checking for floppy disks in BIOS. May be
  1839. needed to boot from old floppy disks.
  1840. ERST
  1841. DEF("no-acpi", 0, QEMU_OPTION_no_acpi,
  1842. "-no-acpi disable ACPI\n", QEMU_ARCH_I386 | QEMU_ARCH_ARM)
  1843. SRST
  1844. ``-no-acpi``
  1845. Disable ACPI (Advanced Configuration and Power Interface) support.
  1846. Use it if your guest OS complains about ACPI problems (PC target
  1847. machine only).
  1848. ERST
  1849. DEF("no-hpet", 0, QEMU_OPTION_no_hpet,
  1850. "-no-hpet disable HPET\n", QEMU_ARCH_I386)
  1851. SRST
  1852. ``-no-hpet``
  1853. Disable HPET support.
  1854. ERST
  1855. DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable,
  1856. "-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"
  1857. " ACPI table description\n", QEMU_ARCH_I386)
  1858. SRST
  1859. ``-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n] [,asl_compiler_id=str][,asl_compiler_rev=n][,data=file1[:file2]...]``
  1860. Add ACPI table with specified header fields and context from
  1861. specified files. For file=, take whole ACPI table from the specified
  1862. files, including all ACPI headers (possible overridden by other
  1863. options). For data=, only data portion of the table is used, all
  1864. header information is specified in the command line. If a SLIC table
  1865. is supplied to QEMU, then the SLIC's oem\_id and oem\_table\_id
  1866. fields will override the same in the RSDT and the FADT (a.k.a.
  1867. FACP), in order to ensure the field matches required by the
  1868. Microsoft SLIC spec and the ACPI spec.
  1869. ERST
  1870. DEF("smbios", HAS_ARG, QEMU_OPTION_smbios,
  1871. "-smbios file=binary\n"
  1872. " load SMBIOS entry from binary file\n"
  1873. "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]\n"
  1874. " [,uefi=on|off]\n"
  1875. " specify SMBIOS type 0 fields\n"
  1876. "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
  1877. " [,uuid=uuid][,sku=str][,family=str]\n"
  1878. " specify SMBIOS type 1 fields\n"
  1879. "-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str]\n"
  1880. " [,asset=str][,location=str]\n"
  1881. " specify SMBIOS type 2 fields\n"
  1882. "-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str]\n"
  1883. " [,sku=str]\n"
  1884. " specify SMBIOS type 3 fields\n"
  1885. "-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str]\n"
  1886. " [,asset=str][,part=str]\n"
  1887. " specify SMBIOS type 4 fields\n"
  1888. "-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str]\n"
  1889. " [,asset=str][,part=str][,speed=%d]\n"
  1890. " specify SMBIOS type 17 fields\n",
  1891. QEMU_ARCH_I386 | QEMU_ARCH_ARM)
  1892. SRST
  1893. ``-smbios file=binary``
  1894. Load SMBIOS entry from binary file.
  1895. ``-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d][,uefi=on|off]``
  1896. Specify SMBIOS type 0 fields
  1897. ``-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str][,uuid=uuid][,sku=str][,family=str]``
  1898. Specify SMBIOS type 1 fields
  1899. ``-smbios type=2[,manufacturer=str][,product=str][,version=str][,serial=str][,asset=str][,location=str]``
  1900. Specify SMBIOS type 2 fields
  1901. ``-smbios type=3[,manufacturer=str][,version=str][,serial=str][,asset=str][,sku=str]``
  1902. Specify SMBIOS type 3 fields
  1903. ``-smbios type=4[,sock_pfx=str][,manufacturer=str][,version=str][,serial=str][,asset=str][,part=str]``
  1904. Specify SMBIOS type 4 fields
  1905. ``-smbios type=17[,loc_pfx=str][,bank=str][,manufacturer=str][,serial=str][,asset=str][,part=str][,speed=%d]``
  1906. Specify SMBIOS type 17 fields
  1907. ERST
  1908. DEFHEADING()
  1909. DEFHEADING(Network options:)
  1910. DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
  1911. #ifdef CONFIG_SLIRP
  1912. "-netdev user,id=str[,ipv4[=on|off]][,net=addr[/mask]][,host=addr]\n"
  1913. " [,ipv6[=on|off]][,ipv6-net=addr[/int]][,ipv6-host=addr]\n"
  1914. " [,restrict=on|off][,hostname=host][,dhcpstart=addr]\n"
  1915. " [,dns=addr][,ipv6-dns=addr][,dnssearch=domain][,domainname=domain]\n"
  1916. " [,tftp=dir][,tftp-server-name=name][,bootfile=f][,hostfwd=rule][,guestfwd=rule]"
  1917. #ifndef _WIN32
  1918. "[,smb=dir[,smbserver=addr]]\n"
  1919. #endif
  1920. " configure a user mode network backend with ID 'str',\n"
  1921. " its DHCP server and optional services\n"
  1922. #endif
  1923. #ifdef _WIN32
  1924. "-netdev tap,id=str,ifname=name\n"
  1925. " configure a host TAP network backend with ID 'str'\n"
  1926. #else
  1927. "-netdev tap,id=str[,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile]\n"
  1928. " [,br=bridge][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off]\n"
  1929. " [,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]\n"
  1930. " [,poll-us=n]\n"
  1931. " configure a host TAP network backend with ID 'str'\n"
  1932. " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
  1933. " use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n"
  1934. " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n"
  1935. " to deconfigure it\n"
  1936. " use '[down]script=no' to disable script execution\n"
  1937. " use network helper 'helper' (default=" DEFAULT_BRIDGE_HELPER ") to\n"
  1938. " configure it\n"
  1939. " use 'fd=h' to connect to an already opened TAP interface\n"
  1940. " use 'fds=x:y:...:z' to connect to already opened multiqueue capable TAP interfaces\n"
  1941. " use 'sndbuf=nbytes' to limit the size of the send buffer (the\n"
  1942. " default is disabled 'sndbuf=0' to enable flow control set 'sndbuf=1048576')\n"
  1943. " use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag\n"
  1944. " use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition\n"
  1945. " use vhost=on to enable experimental in kernel accelerator\n"
  1946. " (only has effect for virtio guests which use MSIX)\n"
  1947. " use vhostforce=on to force vhost on for non-MSIX virtio guests\n"
  1948. " use 'vhostfd=h' to connect to an already opened vhost net device\n"
  1949. " use 'vhostfds=x:y:...:z to connect to multiple already opened vhost net devices\n"
  1950. " use 'queues=n' to specify the number of queues to be created for multiqueue TAP\n"
  1951. " use 'poll-us=n' to speciy the maximum number of microseconds that could be\n"
  1952. " spent on busy polling for vhost net\n"
  1953. "-netdev bridge,id=str[,br=bridge][,helper=helper]\n"
  1954. " configure a host TAP network backend with ID 'str' that is\n"
  1955. " connected to a bridge (default=" DEFAULT_BRIDGE_INTERFACE ")\n"
  1956. " using the program 'helper (default=" DEFAULT_BRIDGE_HELPER ")\n"
  1957. #endif
  1958. #ifdef __linux__
  1959. "-netdev l2tpv3,id=str,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport]\n"
  1960. " [,rxsession=rxsession],txsession=txsession[,ipv6=on/off][,udp=on/off]\n"
  1961. " [,cookie64=on/off][,counter][,pincounter][,txcookie=txcookie]\n"
  1962. " [,rxcookie=rxcookie][,offset=offset]\n"
  1963. " configure a network backend with ID 'str' connected to\n"
  1964. " an Ethernet over L2TPv3 pseudowire.\n"
  1965. " Linux kernel 3.3+ as well as most routers can talk\n"
  1966. " L2TPv3. This transport allows connecting a VM to a VM,\n"
  1967. " VM to a router and even VM to Host. It is a nearly-universal\n"
  1968. " standard (RFC3931). Note - this implementation uses static\n"
  1969. " pre-configured tunnels (same as the Linux kernel).\n"
  1970. " use 'src=' to specify source address\n"
  1971. " use 'dst=' to specify destination address\n"
  1972. " use 'udp=on' to specify udp encapsulation\n"
  1973. " use 'srcport=' to specify source udp port\n"
  1974. " use 'dstport=' to specify destination udp port\n"
  1975. " use 'ipv6=on' to force v6\n"
  1976. " L2TPv3 uses cookies to prevent misconfiguration as\n"
  1977. " well as a weak security measure\n"
  1978. " use 'rxcookie=0x012345678' to specify a rxcookie\n"
  1979. " use 'txcookie=0x012345678' to specify a txcookie\n"
  1980. " use 'cookie64=on' to set cookie size to 64 bit, otherwise 32\n"
  1981. " use 'counter=off' to force a 'cut-down' L2TPv3 with no counter\n"
  1982. " use 'pincounter=on' to work around broken counter handling in peer\n"
  1983. " use 'offset=X' to add an extra offset between header and data\n"
  1984. #endif
  1985. "-netdev socket,id=str[,fd=h][,listen=[host]:port][,connect=host:port]\n"
  1986. " configure a network backend to connect to another network\n"
  1987. " using a socket connection\n"
  1988. "-netdev socket,id=str[,fd=h][,mcast=maddr:port[,localaddr=addr]]\n"
  1989. " configure a network backend to connect to a multicast maddr and port\n"
  1990. " use 'localaddr=addr' to specify the host address to send packets from\n"
  1991. "-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n"
  1992. " configure a network backend to connect to another network\n"
  1993. " using an UDP tunnel\n"
  1994. #ifdef CONFIG_VDE
  1995. "-netdev vde,id=str[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n"
  1996. " configure a network backend to connect to port 'n' of a vde switch\n"
  1997. " running on host and listening for incoming connections on 'socketpath'.\n"
  1998. " Use group 'groupname' and mode 'octalmode' to change default\n"
  1999. " ownership and permissions for communication port.\n"
  2000. #endif
  2001. #ifdef CONFIG_NETMAP
  2002. "-netdev netmap,id=str,ifname=name[,devname=nmname]\n"
  2003. " attach to the existing netmap-enabled network interface 'name', or to a\n"
  2004. " VALE port (created on the fly) called 'name' ('nmname' is name of the \n"
  2005. " netmap device, defaults to '/dev/netmap')\n"
  2006. #endif
  2007. #ifdef CONFIG_POSIX
  2008. "-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n"
  2009. " configure a vhost-user network, backed by a chardev 'dev'\n"
  2010. #endif
  2011. "-netdev hubport,id=str,hubid=n[,netdev=nd]\n"
  2012. " configure a hub port on the hub with ID 'n'\n", QEMU_ARCH_ALL)
  2013. DEF("nic", HAS_ARG, QEMU_OPTION_nic,
  2014. "-nic [tap|bridge|"
  2015. #ifdef CONFIG_SLIRP
  2016. "user|"
  2017. #endif
  2018. #ifdef __linux__
  2019. "l2tpv3|"
  2020. #endif
  2021. #ifdef CONFIG_VDE
  2022. "vde|"
  2023. #endif
  2024. #ifdef CONFIG_NETMAP
  2025. "netmap|"
  2026. #endif
  2027. #ifdef CONFIG_POSIX
  2028. "vhost-user|"
  2029. #endif
  2030. "socket][,option][,...][mac=macaddr]\n"
  2031. " initialize an on-board / default host NIC (using MAC address\n"
  2032. " macaddr) and connect it to the given host network backend\n"
  2033. "-nic none use it alone to have zero network devices (the default is to\n"
  2034. " provided a 'user' network connection)\n",
  2035. QEMU_ARCH_ALL)
  2036. DEF("net", HAS_ARG, QEMU_OPTION_net,
  2037. "-net nic[,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n"
  2038. " configure or create an on-board (or machine default) NIC and\n"
  2039. " connect it to hub 0 (please use -nic unless you need a hub)\n"
  2040. "-net ["
  2041. #ifdef CONFIG_SLIRP
  2042. "user|"
  2043. #endif
  2044. "tap|"
  2045. "bridge|"
  2046. #ifdef CONFIG_VDE
  2047. "vde|"
  2048. #endif
  2049. #ifdef CONFIG_NETMAP
  2050. "netmap|"
  2051. #endif
  2052. "socket][,option][,option][,...]\n"
  2053. " old way to initialize a host network interface\n"
  2054. " (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL)
  2055. SRST
  2056. ``-nic [tap|bridge|user|l2tpv3|vde|netmap|vhost-user|socket][,...][,mac=macaddr][,model=mn]``
  2057. This option is a shortcut for configuring both the on-board
  2058. (default) guest NIC hardware and the host network backend in one go.
  2059. The host backend options are the same as with the corresponding
  2060. ``-netdev`` options below. The guest NIC model can be set with
  2061. ``model=modelname``. Use ``model=help`` to list the available device
  2062. types. The hardware MAC address can be set with ``mac=macaddr``.
  2063. The following two example do exactly the same, to show how ``-nic``
  2064. can be used to shorten the command line length:
  2065. .. parsed-literal::
  2066. |qemu_system| -netdev user,id=n1,ipv6=off -device e1000,netdev=n1,mac=52:54:98:76:54:32
  2067. |qemu_system| -nic user,ipv6=off,model=e1000,mac=52:54:98:76:54:32
  2068. ``-nic none``
  2069. Indicate that no network devices should be configured. It is used to
  2070. override the default configuration (default NIC with "user" host
  2071. network backend) which is activated if no other networking options
  2072. are provided.
  2073. ``-netdev user,id=id[,option][,option][,...]``
  2074. Configure user mode host network backend which requires no
  2075. administrator privilege to run. Valid options are:
  2076. ``id=id``
  2077. Assign symbolic name for use in monitor commands.
  2078. ``ipv4=on|off and ipv6=on|off``
  2079. Specify that either IPv4 or IPv6 must be enabled. If neither is
  2080. specified both protocols are enabled.
  2081. ``net=addr[/mask]``
  2082. Set IP network address the guest will see. Optionally specify
  2083. the netmask, either in the form a.b.c.d or as number of valid
  2084. top-most bits. Default is 10.0.2.0/24.
  2085. ``host=addr``
  2086. Specify the guest-visible address of the host. Default is the
  2087. 2nd IP in the guest network, i.e. x.x.x.2.
  2088. ``ipv6-net=addr[/int]``
  2089. Set IPv6 network address the guest will see (default is
  2090. fec0::/64). The network prefix is given in the usual hexadecimal
  2091. IPv6 address notation. The prefix size is optional, and is given
  2092. as the number of valid top-most bits (default is 64).
  2093. ``ipv6-host=addr``
  2094. Specify the guest-visible IPv6 address of the host. Default is
  2095. the 2nd IPv6 in the guest network, i.e. xxxx::2.
  2096. ``restrict=on|off``
  2097. If this option is enabled, the guest will be isolated, i.e. it
  2098. will not be able to contact the host and no guest IP packets
  2099. will be routed over the host to the outside. This option does
  2100. not affect any explicitly set forwarding rules.
  2101. ``hostname=name``
  2102. Specifies the client hostname reported by the built-in DHCP
  2103. server.
  2104. ``dhcpstart=addr``
  2105. Specify the first of the 16 IPs the built-in DHCP server can
  2106. assign. Default is the 15th to 31st IP in the guest network,
  2107. i.e. x.x.x.15 to x.x.x.31.
  2108. ``dns=addr``
  2109. Specify the guest-visible address of the virtual nameserver. The
  2110. address must be different from the host address. Default is the
  2111. 3rd IP in the guest network, i.e. x.x.x.3.
  2112. ``ipv6-dns=addr``
  2113. Specify the guest-visible address of the IPv6 virtual
  2114. nameserver. The address must be different from the host address.
  2115. Default is the 3rd IP in the guest network, i.e. xxxx::3.
  2116. ``dnssearch=domain``
  2117. Provides an entry for the domain-search list sent by the
  2118. built-in DHCP server. More than one domain suffix can be
  2119. transmitted by specifying this option multiple times. If
  2120. supported, this will cause the guest to automatically try to
  2121. append the given domain suffix(es) in case a domain name can not
  2122. be resolved.
  2123. Example:
  2124. .. parsed-literal::
  2125. |qemu_system| -nic user,dnssearch=mgmt.example.org,dnssearch=example.org
  2126. ``domainname=domain``
  2127. Specifies the client domain name reported by the built-in DHCP
  2128. server.
  2129. ``tftp=dir``
  2130. When using the user mode network stack, activate a built-in TFTP
  2131. server. The files in dir will be exposed as the root of a TFTP
  2132. server. The TFTP client on the guest must be configured in
  2133. binary mode (use the command ``bin`` of the Unix TFTP client).
  2134. ``tftp-server-name=name``
  2135. In BOOTP reply, broadcast name as the "TFTP server name"
  2136. (RFC2132 option 66). This can be used to advise the guest to
  2137. load boot files or configurations from a different server than
  2138. the host address.
  2139. ``bootfile=file``
  2140. When using the user mode network stack, broadcast file as the
  2141. BOOTP filename. In conjunction with ``tftp``, this can be used
  2142. to network boot a guest from a local directory.
  2143. Example (using pxelinux):
  2144. .. parsed-literal::
  2145. |qemu_system| -hda linux.img -boot n -device e1000,netdev=n1 \
  2146. -netdev user,id=n1,tftp=/path/to/tftp/files,bootfile=/pxelinux.0
  2147. ``smb=dir[,smbserver=addr]``
  2148. When using the user mode network stack, activate a built-in SMB
  2149. server so that Windows OSes can access to the host files in
  2150. ``dir`` transparently. The IP address of the SMB server can be
  2151. set to addr. By default the 4th IP in the guest network is used,
  2152. i.e. x.x.x.4.
  2153. In the guest Windows OS, the line:
  2154. ::
  2155. 10.0.2.4 smbserver
  2156. must be added in the file ``C:\WINDOWS\LMHOSTS`` (for windows
  2157. 9x/Me) or ``C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS`` (Windows
  2158. NT/2000).
  2159. Then ``dir`` can be accessed in ``\\smbserver\qemu``.
  2160. Note that a SAMBA server must be installed on the host OS.
  2161. ``hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport``
  2162. Redirect incoming TCP or UDP connections to the host port
  2163. hostport to the guest IP address guestaddr on guest port
  2164. guestport. If guestaddr is not specified, its value is x.x.x.15
  2165. (default first address given by the built-in DHCP server). By
  2166. specifying hostaddr, the rule can be bound to a specific host
  2167. interface. If no connection type is set, TCP is used. This
  2168. option can be given multiple times.
  2169. For example, to redirect host X11 connection from screen 1 to
  2170. guest screen 0, use the following:
  2171. .. parsed-literal::
  2172. # on the host
  2173. |qemu_system| -nic user,hostfwd=tcp:127.0.0.1:6001-:6000
  2174. # this host xterm should open in the guest X11 server
  2175. xterm -display :1
  2176. To redirect telnet connections from host port 5555 to telnet
  2177. port on the guest, use the following:
  2178. .. parsed-literal::
  2179. # on the host
  2180. |qemu_system| -nic user,hostfwd=tcp::5555-:23
  2181. telnet localhost 5555
  2182. Then when you use on the host ``telnet localhost 5555``, you
  2183. connect to the guest telnet server.
  2184. ``guestfwd=[tcp]:server:port-dev``; \ ``guestfwd=[tcp]:server:port-cmd:command``
  2185. Forward guest TCP connections to the IP address server on port
  2186. port to the character device dev or to a program executed by
  2187. cmd:command which gets spawned for each connection. This option
  2188. can be given multiple times.
  2189. You can either use a chardev directly and have that one used
  2190. throughout QEMU's lifetime, like in the following example:
  2191. .. parsed-literal::
  2192. # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever
  2193. # the guest accesses it
  2194. |qemu_system| -nic user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321
  2195. Or you can execute a command on every TCP connection established
  2196. by the guest, so that QEMU behaves similar to an inetd process
  2197. for that virtual server:
  2198. .. parsed-literal::
  2199. # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234
  2200. # and connect the TCP stream to its stdin/stdout
  2201. |qemu_system| -nic 'user,id=n1,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321'
  2202. ``-netdev tap,id=id[,fd=h][,ifname=name][,script=file][,downscript=dfile][,br=bridge][,helper=helper]``
  2203. Configure a host TAP network backend with ID id.
  2204. Use the network script file to configure it and the network script
  2205. dfile to deconfigure it. If name is not provided, the OS
  2206. automatically provides one. The default network configure script is
  2207. ``/etc/qemu-ifup`` and the default network deconfigure script is
  2208. ``/etc/qemu-ifdown``. Use ``script=no`` or ``downscript=no`` to
  2209. disable script execution.
  2210. If running QEMU as an unprivileged user, use the network helper
  2211. helper to configure the TAP interface and attach it to the bridge.
  2212. The default network helper executable is
  2213. ``/path/to/qemu-bridge-helper`` and the default bridge device is
  2214. ``br0``.
  2215. ``fd``\ =h can be used to specify the handle of an already opened
  2216. host TAP interface.
  2217. Examples:
  2218. .. parsed-literal::
  2219. #launch a QEMU instance with the default network script
  2220. |qemu_system| linux.img -nic tap
  2221. .. parsed-literal::
  2222. #launch a QEMU instance with two NICs, each one connected
  2223. #to a TAP device
  2224. |qemu_system| linux.img \
  2225. -netdev tap,id=nd0,ifname=tap0 -device e1000,netdev=nd0 \
  2226. -netdev tap,id=nd1,ifname=tap1 -device rtl8139,netdev=nd1
  2227. .. parsed-literal::
  2228. #launch a QEMU instance with the default network helper to
  2229. #connect a TAP device to bridge br0
  2230. |qemu_system| linux.img -device virtio-net-pci,netdev=n1 \
  2231. -netdev tap,id=n1,"helper=/path/to/qemu-bridge-helper"
  2232. ``-netdev bridge,id=id[,br=bridge][,helper=helper]``
  2233. Connect a host TAP network interface to a host bridge device.
  2234. Use the network helper helper to configure the TAP interface and
  2235. attach it to the bridge. The default network helper executable is
  2236. ``/path/to/qemu-bridge-helper`` and the default bridge device is
  2237. ``br0``.
  2238. Examples:
  2239. .. parsed-literal::
  2240. #launch a QEMU instance with the default network helper to
  2241. #connect a TAP device to bridge br0
  2242. |qemu_system| linux.img -netdev bridge,id=n1 -device virtio-net,netdev=n1
  2243. .. parsed-literal::
  2244. #launch a QEMU instance with the default network helper to
  2245. #connect a TAP device to bridge qemubr0
  2246. |qemu_system| linux.img -netdev bridge,br=qemubr0,id=n1 -device virtio-net,netdev=n1
  2247. ``-netdev socket,id=id[,fd=h][,listen=[host]:port][,connect=host:port]``
  2248. This host network backend can be used to connect the guest's network
  2249. to another QEMU virtual machine using a TCP socket connection. If
  2250. ``listen`` is specified, QEMU waits for incoming connections on port
  2251. (host is optional). ``connect`` is used to connect to another QEMU
  2252. instance using the ``listen`` option. ``fd``\ =h specifies an
  2253. already opened TCP socket.
  2254. Example:
  2255. .. parsed-literal::
  2256. # launch a first QEMU instance
  2257. |qemu_system| linux.img \
  2258. -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
  2259. -netdev socket,id=n1,listen=:1234
  2260. # connect the network of this instance to the network of the first instance
  2261. |qemu_system| linux.img \
  2262. -device e1000,netdev=n2,mac=52:54:00:12:34:57 \
  2263. -netdev socket,id=n2,connect=127.0.0.1:1234
  2264. ``-netdev socket,id=id[,fd=h][,mcast=maddr:port[,localaddr=addr]]``
  2265. Configure a socket host network backend to share the guest's network
  2266. traffic with another QEMU virtual machines using a UDP multicast
  2267. socket, effectively making a bus for every QEMU with same multicast
  2268. address maddr and port. NOTES:
  2269. 1. Several QEMU can be running on different hosts and share same bus
  2270. (assuming correct multicast setup for these hosts).
  2271. 2. mcast support is compatible with User Mode Linux (argument
  2272. ``ethN=mcast``), see http://user-mode-linux.sf.net.
  2273. 3. Use ``fd=h`` to specify an already opened UDP multicast socket.
  2274. Example:
  2275. .. parsed-literal::
  2276. # launch one QEMU instance
  2277. |qemu_system| linux.img \
  2278. -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
  2279. -netdev socket,id=n1,mcast=230.0.0.1:1234
  2280. # launch another QEMU instance on same "bus"
  2281. |qemu_system| linux.img \
  2282. -device e1000,netdev=n2,mac=52:54:00:12:34:57 \
  2283. -netdev socket,id=n2,mcast=230.0.0.1:1234
  2284. # launch yet another QEMU instance on same "bus"
  2285. |qemu_system| linux.img \
  2286. -device e1000,netdev=n3,mac=52:54:00:12:34:58 \
  2287. -netdev socket,id=n3,mcast=230.0.0.1:1234
  2288. Example (User Mode Linux compat.):
  2289. .. parsed-literal::
  2290. # launch QEMU instance (note mcast address selected is UML's default)
  2291. |qemu_system| linux.img \
  2292. -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
  2293. -netdev socket,id=n1,mcast=239.192.168.1:1102
  2294. # launch UML
  2295. /path/to/linux ubd0=/path/to/root_fs eth0=mcast
  2296. Example (send packets from host's 1.2.3.4):
  2297. .. parsed-literal::
  2298. |qemu_system| linux.img \
  2299. -device e1000,netdev=n1,mac=52:54:00:12:34:56 \
  2300. -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4
  2301. ``-netdev l2tpv3,id=id,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6][,udp][,cookie64][,counter][,pincounter][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]``
  2302. Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3931)
  2303. is a popular protocol to transport Ethernet (and other Layer 2) data
  2304. frames between two systems. It is present in routers, firewalls and
  2305. the Linux kernel (from version 3.3 onwards).
  2306. This transport allows a VM to communicate to another VM, router or
  2307. firewall directly.
  2308. ``src=srcaddr``
  2309. source address (mandatory)
  2310. ``dst=dstaddr``
  2311. destination address (mandatory)
  2312. ``udp``
  2313. select udp encapsulation (default is ip).
  2314. ``srcport=srcport``
  2315. source udp port.
  2316. ``dstport=dstport``
  2317. destination udp port.
  2318. ``ipv6``
  2319. force v6, otherwise defaults to v4.
  2320. ``rxcookie=rxcookie``; \ ``txcookie=txcookie``
  2321. Cookies are a weak form of security in the l2tpv3 specification.
  2322. Their function is mostly to prevent misconfiguration. By default
  2323. they are 32 bit.
  2324. ``cookie64``
  2325. Set cookie size to 64 bit instead of the default 32
  2326. ``counter=off``
  2327. Force a 'cut-down' L2TPv3 with no counter as in
  2328. draft-mkonstan-l2tpext-keyed-ipv6-tunnel-00
  2329. ``pincounter=on``
  2330. Work around broken counter handling in peer. This may also help
  2331. on networks which have packet reorder.
  2332. ``offset=offset``
  2333. Add an extra offset between header and data
  2334. For example, to attach a VM running on host 4.3.2.1 via L2TPv3 to
  2335. the bridge br-lan on the remote Linux host 1.2.3.4:
  2336. .. parsed-literal::
  2337. # Setup tunnel on linux host using raw ip as encapsulation
  2338. # on 1.2.3.4
  2339. ip l2tp add tunnel remote 4.3.2.1 local 1.2.3.4 tunnel_id 1 peer_tunnel_id 1 \
  2340. encap udp udp_sport 16384 udp_dport 16384
  2341. ip l2tp add session tunnel_id 1 name vmtunnel0 session_id \
  2342. 0xFFFFFFFF peer_session_id 0xFFFFFFFF
  2343. ifconfig vmtunnel0 mtu 1500
  2344. ifconfig vmtunnel0 up
  2345. brctl addif br-lan vmtunnel0
  2346. # on 4.3.2.1
  2347. # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter
  2348. |qemu_system| linux.img -device e1000,netdev=n1 \
  2349. -netdev l2tpv3,id=n1,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter
  2350. ``-netdev vde,id=id[,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]``
  2351. Configure VDE backend to connect to PORT n of a vde switch running
  2352. on host and listening for incoming connections on socketpath. Use
  2353. GROUP groupname and MODE octalmode to change default ownership and
  2354. permissions for communication port. This option is only available if
  2355. QEMU has been compiled with vde support enabled.
  2356. Example:
  2357. .. parsed-literal::
  2358. # launch vde switch
  2359. vde_switch -F -sock /tmp/myswitch
  2360. # launch QEMU instance
  2361. |qemu_system| linux.img -nic vde,sock=/tmp/myswitch
  2362. ``-netdev vhost-user,chardev=id[,vhostforce=on|off][,queues=n]``
  2363. Establish a vhost-user netdev, backed by a chardev id. The chardev
  2364. should be a unix domain socket backed one. The vhost-user uses a
  2365. specifically defined protocol to pass vhost ioctl replacement
  2366. messages to an application on the other end of the socket. On
  2367. non-MSIX guests, the feature can be forced with vhostforce. Use
  2368. 'queues=n' to specify the number of queues to be created for
  2369. multiqueue vhost-user.
  2370. Example:
  2371. ::
  2372. qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \
  2373. -numa node,memdev=mem \
  2374. -chardev socket,id=chr0,path=/path/to/socket \
  2375. -netdev type=vhost-user,id=net0,chardev=chr0 \
  2376. -device virtio-net-pci,netdev=net0
  2377. ``-netdev hubport,id=id,hubid=hubid[,netdev=nd]``
  2378. Create a hub port on the emulated hub with ID hubid.
  2379. The hubport netdev lets you connect a NIC to a QEMU emulated hub
  2380. instead of a single netdev. Alternatively, you can also connect the
  2381. hubport to another netdev with ID nd by using the ``netdev=nd``
  2382. option.
  2383. ``-net nic[,netdev=nd][,macaddr=mac][,model=type] [,name=name][,addr=addr][,vectors=v]``
  2384. Legacy option to configure or create an on-board (or machine
  2385. default) Network Interface Card(NIC) and connect it either to the
  2386. emulated hub with ID 0 (i.e. the default hub), or to the netdev nd.
  2387. If model is omitted, then the default NIC model associated with the
  2388. machine type is used. Note that the default NIC model may change in
  2389. future QEMU releases, so it is highly recommended to always specify
  2390. a model. Optionally, the MAC address can be changed to mac, the
  2391. device address set to addr (PCI cards only), and a name can be
  2392. assigned for use in monitor commands. Optionally, for PCI cards, you
  2393. can specify the number v of MSI-X vectors that the card should have;
  2394. this option currently only affects virtio cards; set v = 0 to
  2395. disable MSI-X. If no ``-net`` option is specified, a single NIC is
  2396. created. QEMU can emulate several different models of network card.
  2397. Use ``-net nic,model=help`` for a list of available devices for your
  2398. target.
  2399. ``-net user|tap|bridge|socket|l2tpv3|vde[,...][,name=name]``
  2400. Configure a host network backend (with the options corresponding to
  2401. the same ``-netdev`` option) and connect it to the emulated hub 0
  2402. (the default hub). Use name to specify the name of the hub port.
  2403. ERST
  2404. DEFHEADING()
  2405. DEFHEADING(Character device options:)
  2406. DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
  2407. "-chardev help\n"
  2408. "-chardev null,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2409. "-chardev socket,id=id[,host=host],port=port[,to=to][,ipv4][,ipv6][,nodelay][,reconnect=seconds]\n"
  2410. " [,server][,nowait][,telnet][,websocket][,reconnect=seconds][,mux=on|off]\n"
  2411. " [,logfile=PATH][,logappend=on|off][,tls-creds=ID][,tls-authz=ID] (tcp)\n"
  2412. "-chardev socket,id=id,path=path[,server][,nowait][,telnet][,websocket][,reconnect=seconds]\n"
  2413. " [,mux=on|off][,logfile=PATH][,logappend=on|off] (unix)\n"
  2414. "-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr]\n"
  2415. " [,localport=localport][,ipv4][,ipv6][,mux=on|off]\n"
  2416. " [,logfile=PATH][,logappend=on|off]\n"
  2417. "-chardev msmouse,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2418. "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n"
  2419. " [,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2420. "-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n"
  2421. "-chardev file,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2422. "-chardev pipe,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2423. #ifdef _WIN32
  2424. "-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2425. "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2426. #else
  2427. "-chardev pty,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2428. "-chardev stdio,id=id[,mux=on|off][,signal=on|off][,logfile=PATH][,logappend=on|off]\n"
  2429. #endif
  2430. #ifdef CONFIG_BRLAPI
  2431. "-chardev braille,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2432. #endif
  2433. #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
  2434. || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
  2435. "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2436. "-chardev tty,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2437. #endif
  2438. #if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
  2439. "-chardev parallel,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2440. "-chardev parport,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
  2441. #endif
  2442. #if defined(CONFIG_SPICE)
  2443. "-chardev spicevmc,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
  2444. "-chardev spiceport,id=id,name=name[,debug=debug][,logfile=PATH][,logappend=on|off]\n"
  2445. #endif
  2446. , QEMU_ARCH_ALL
  2447. )
  2448. SRST
  2449. The general form of a character device option is:
  2450. ``-chardev backend,id=id[,mux=on|off][,options]``
  2451. Backend is one of: ``null``, ``socket``, ``udp``, ``msmouse``,
  2452. ``vc``, ``ringbuf``, ``file``, ``pipe``, ``console``, ``serial``,
  2453. ``pty``, ``stdio``, ``braille``, ``tty``, ``parallel``, ``parport``,
  2454. ``spicevmc``, ``spiceport``. The specific backend will determine the
  2455. applicable options.
  2456. Use ``-chardev help`` to print all available chardev backend types.
  2457. All devices must have an id, which can be any string up to 127
  2458. characters long. It is used to uniquely identify this device in
  2459. other command line directives.
  2460. A character device may be used in multiplexing mode by multiple
  2461. front-ends. Specify ``mux=on`` to enable this mode. A multiplexer is
  2462. a "1:N" device, and here the "1" end is your specified chardev
  2463. backend, and the "N" end is the various parts of QEMU that can talk
  2464. to a chardev. If you create a chardev with ``id=myid`` and
  2465. ``mux=on``, QEMU will create a multiplexer with your specified ID,
  2466. and you can then configure multiple front ends to use that chardev
  2467. ID for their input/output. Up to four different front ends can be
  2468. connected to a single multiplexed chardev. (Without multiplexing
  2469. enabled, a chardev can only be used by a single front end.) For
  2470. instance you could use this to allow a single stdio chardev to be
  2471. used by two serial ports and the QEMU monitor:
  2472. ::
  2473. -chardev stdio,mux=on,id=char0 \
  2474. -mon chardev=char0,mode=readline \
  2475. -serial chardev:char0 \
  2476. -serial chardev:char0
  2477. You can have more than one multiplexer in a system configuration;
  2478. for instance you could have a TCP port multiplexed between UART 0
  2479. and UART 1, and stdio multiplexed between the QEMU monitor and a
  2480. parallel port:
  2481. ::
  2482. -chardev stdio,mux=on,id=char0 \
  2483. -mon chardev=char0,mode=readline \
  2484. -parallel chardev:char0 \
  2485. -chardev tcp,...,mux=on,id=char1 \
  2486. -serial chardev:char1 \
  2487. -serial chardev:char1
  2488. When you're using a multiplexed character device, some escape
  2489. sequences are interpreted in the input. See :ref:`mux_005fkeys`.
  2490. Note that some other command line options may implicitly create
  2491. multiplexed character backends; for instance ``-serial mon:stdio``
  2492. creates a multiplexed stdio backend connected to the serial port and
  2493. the QEMU monitor, and ``-nographic`` also multiplexes the console
  2494. and the monitor to stdio.
  2495. There is currently no support for multiplexing in the other
  2496. direction (where a single QEMU front end takes input and output from
  2497. multiple chardevs).
  2498. Every backend supports the ``logfile`` option, which supplies the
  2499. path to a file to record all data transmitted via the backend. The
  2500. ``logappend`` option controls whether the log file will be truncated
  2501. or appended to when opened.
  2502. The available backends are:
  2503. ``-chardev null,id=id``
  2504. A void device. This device will not emit any data, and will drop any
  2505. data it receives. The null backend does not take any options.
  2506. ``-chardev socket,id=id[,TCP options or unix options][,server][,nowait][,telnet][,websocket][,reconnect=seconds][,tls-creds=id][,tls-authz=id]``
  2507. Create a two-way stream socket, which can be either a TCP or a unix
  2508. socket. A unix socket will be created if ``path`` is specified.
  2509. Behaviour is undefined if TCP options are specified for a unix
  2510. socket.
  2511. ``server`` specifies that the socket shall be a listening socket.
  2512. ``nowait`` specifies that QEMU should not block waiting for a client
  2513. to connect to a listening socket.
  2514. ``telnet`` specifies that traffic on the socket should interpret
  2515. telnet escape sequences.
  2516. ``websocket`` specifies that the socket uses WebSocket protocol for
  2517. communication.
  2518. ``reconnect`` sets the timeout for reconnecting on non-server
  2519. sockets when the remote end goes away. qemu will delay this many
  2520. seconds and then attempt to reconnect. Zero disables reconnecting,
  2521. and is the default.
  2522. ``tls-creds`` requests enablement of the TLS protocol for
  2523. encryption, and specifies the id of the TLS credentials to use for
  2524. the handshake. The credentials must be previously created with the
  2525. ``-object tls-creds`` argument.
  2526. ``tls-auth`` provides the ID of the QAuthZ authorization object
  2527. against which the client's x509 distinguished name will be
  2528. validated. This object is only resolved at time of use, so can be
  2529. deleted and recreated on the fly while the chardev server is active.
  2530. If missing, it will default to denying access.
  2531. TCP and unix socket options are given below:
  2532. ``TCP options: port=port[,host=host][,to=to][,ipv4][,ipv6][,nodelay]``
  2533. ``host`` for a listening socket specifies the local address to
  2534. be bound. For a connecting socket species the remote host to
  2535. connect to. ``host`` is optional for listening sockets. If not
  2536. specified it defaults to ``0.0.0.0``.
  2537. ``port`` for a listening socket specifies the local port to be
  2538. bound. For a connecting socket specifies the port on the remote
  2539. host to connect to. ``port`` can be given as either a port
  2540. number or a service name. ``port`` is required.
  2541. ``to`` is only relevant to listening sockets. If it is
  2542. specified, and ``port`` cannot be bound, QEMU will attempt to
  2543. bind to subsequent ports up to and including ``to`` until it
  2544. succeeds. ``to`` must be specified as a port number.
  2545. ``ipv4`` and ``ipv6`` specify that either IPv4 or IPv6 must be
  2546. used. If neither is specified the socket may use either
  2547. protocol.
  2548. ``nodelay`` disables the Nagle algorithm.
  2549. ``unix options: path=path``
  2550. ``path`` specifies the local path of the unix socket. ``path``
  2551. is required.
  2552. ``-chardev udp,id=id[,host=host],port=port[,localaddr=localaddr][,localport=localport][,ipv4][,ipv6]``
  2553. Sends all traffic from the guest to a remote host over UDP.
  2554. ``host`` specifies the remote host to connect to. If not specified
  2555. it defaults to ``localhost``.
  2556. ``port`` specifies the port on the remote host to connect to.
  2557. ``port`` is required.
  2558. ``localaddr`` specifies the local address to bind to. If not
  2559. specified it defaults to ``0.0.0.0``.
  2560. ``localport`` specifies the local port to bind to. If not specified
  2561. any available local port will be used.
  2562. ``ipv4`` and ``ipv6`` specify that either IPv4 or IPv6 must be used.
  2563. If neither is specified the device may use either protocol.
  2564. ``-chardev msmouse,id=id``
  2565. Forward QEMU's emulated msmouse events to the guest. ``msmouse``
  2566. does not take any options.
  2567. ``-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]``
  2568. Connect to a QEMU text console. ``vc`` may optionally be given a
  2569. specific size.
  2570. ``width`` and ``height`` specify the width and height respectively
  2571. of the console, in pixels.
  2572. ``cols`` and ``rows`` specify that the console be sized to fit a
  2573. text console with the given dimensions.
  2574. ``-chardev ringbuf,id=id[,size=size]``
  2575. Create a ring buffer with fixed size ``size``. size must be a power
  2576. of two and defaults to ``64K``.
  2577. ``-chardev file,id=id,path=path``
  2578. Log all traffic received from the guest to a file.
  2579. ``path`` specifies the path of the file to be opened. This file will
  2580. be created if it does not already exist, and overwritten if it does.
  2581. ``path`` is required.
  2582. ``-chardev pipe,id=id,path=path``
  2583. Create a two-way connection to the guest. The behaviour differs
  2584. slightly between Windows hosts and other hosts:
  2585. On Windows, a single duplex pipe will be created at
  2586. ``\\.pipe\path``.
  2587. On other hosts, 2 pipes will be created called ``path.in`` and
  2588. ``path.out``. Data written to ``path.in`` will be received by the
  2589. guest. Data written by the guest can be read from ``path.out``. QEMU
  2590. will not create these fifos, and requires them to be present.
  2591. ``path`` forms part of the pipe path as described above. ``path`` is
  2592. required.
  2593. ``-chardev console,id=id``
  2594. Send traffic from the guest to QEMU's standard output. ``console``
  2595. does not take any options.
  2596. ``console`` is only available on Windows hosts.
  2597. ``-chardev serial,id=id,path=path``
  2598. Send traffic from the guest to a serial device on the host.
  2599. On Unix hosts serial will actually accept any tty device, not only
  2600. serial lines.
  2601. ``path`` specifies the name of the serial device to open.
  2602. ``-chardev pty,id=id``
  2603. Create a new pseudo-terminal on the host and connect to it. ``pty``
  2604. does not take any options.
  2605. ``pty`` is not available on Windows hosts.
  2606. ``-chardev stdio,id=id[,signal=on|off]``
  2607. Connect to standard input and standard output of the QEMU process.
  2608. ``signal`` controls if signals are enabled on the terminal, that
  2609. includes exiting QEMU with the key sequence Control-c. This option
  2610. is enabled by default, use ``signal=off`` to disable it.
  2611. ``-chardev braille,id=id``
  2612. Connect to a local BrlAPI server. ``braille`` does not take any
  2613. options.
  2614. ``-chardev tty,id=id,path=path``
  2615. ``tty`` is only available on Linux, Sun, FreeBSD, NetBSD, OpenBSD
  2616. and DragonFlyBSD hosts. It is an alias for ``serial``.
  2617. ``path`` specifies the path to the tty. ``path`` is required.
  2618. ``-chardev parallel,id=id,path=path``
  2619. \
  2620. ``-chardev parport,id=id,path=path``
  2621. ``parallel`` is only available on Linux, FreeBSD and DragonFlyBSD
  2622. hosts.
  2623. Connect to a local parallel port.
  2624. ``path`` specifies the path to the parallel port device. ``path`` is
  2625. required.
  2626. ``-chardev spicevmc,id=id,debug=debug,name=name``
  2627. ``spicevmc`` is only available when spice support is built in.
  2628. ``debug`` debug level for spicevmc
  2629. ``name`` name of spice channel to connect to
  2630. Connect to a spice virtual machine channel, such as vdiport.
  2631. ``-chardev spiceport,id=id,debug=debug,name=name``
  2632. ``spiceport`` is only available when spice support is built in.
  2633. ``debug`` debug level for spicevmc
  2634. ``name`` name of spice port to connect to
  2635. Connect to a spice port, allowing a Spice client to handle the
  2636. traffic identified by a name (preferably a fqdn).
  2637. ERST
  2638. DEFHEADING()
  2639. #ifdef CONFIG_TPM
  2640. DEFHEADING(TPM device options:)
  2641. DEF("tpmdev", HAS_ARG, QEMU_OPTION_tpmdev, \
  2642. "-tpmdev passthrough,id=id[,path=path][,cancel-path=path]\n"
  2643. " use path to provide path to a character device; default is /dev/tpm0\n"
  2644. " use cancel-path to provide path to TPM's cancel sysfs entry; if\n"
  2645. " not provided it will be searched for in /sys/class/misc/tpm?/device\n"
  2646. "-tpmdev emulator,id=id,chardev=dev\n"
  2647. " configure the TPM device using chardev backend\n",
  2648. QEMU_ARCH_ALL)
  2649. SRST
  2650. The general form of a TPM device option is:
  2651. ``-tpmdev backend,id=id[,options]``
  2652. The specific backend type will determine the applicable options. The
  2653. ``-tpmdev`` option creates the TPM backend and requires a
  2654. ``-device`` option that specifies the TPM frontend interface model.
  2655. Use ``-tpmdev help`` to print all available TPM backend types.
  2656. The available backends are:
  2657. ``-tpmdev passthrough,id=id,path=path,cancel-path=cancel-path``
  2658. (Linux-host only) Enable access to the host's TPM using the
  2659. passthrough driver.
  2660. ``path`` specifies the path to the host's TPM device, i.e., on a
  2661. Linux host this would be ``/dev/tpm0``. ``path`` is optional and by
  2662. default ``/dev/tpm0`` is used.
  2663. ``cancel-path`` specifies the path to the host TPM device's sysfs
  2664. entry allowing for cancellation of an ongoing TPM command.
  2665. ``cancel-path`` is optional and by default QEMU will search for the
  2666. sysfs entry to use.
  2667. Some notes about using the host's TPM with the passthrough driver:
  2668. The TPM device accessed by the passthrough driver must not be used
  2669. by any other application on the host.
  2670. Since the host's firmware (BIOS/UEFI) has already initialized the
  2671. TPM, the VM's firmware (BIOS/UEFI) will not be able to initialize
  2672. the TPM again and may therefore not show a TPM-specific menu that
  2673. would otherwise allow the user to configure the TPM, e.g., allow the
  2674. user to enable/disable or activate/deactivate the TPM. Further, if
  2675. TPM ownership is released from within a VM then the host's TPM will
  2676. get disabled and deactivated. To enable and activate the TPM again
  2677. afterwards, the host has to be rebooted and the user is required to
  2678. enter the firmware's menu to enable and activate the TPM. If the TPM
  2679. is left disabled and/or deactivated most TPM commands will fail.
  2680. To create a passthrough TPM use the following two options:
  2681. ::
  2682. -tpmdev passthrough,id=tpm0 -device tpm-tis,tpmdev=tpm0
  2683. Note that the ``-tpmdev`` id is ``tpm0`` and is referenced by
  2684. ``tpmdev=tpm0`` in the device option.
  2685. ``-tpmdev emulator,id=id,chardev=dev``
  2686. (Linux-host only) Enable access to a TPM emulator using Unix domain
  2687. socket based chardev backend.
  2688. ``chardev`` specifies the unique ID of a character device backend
  2689. that provides connection to the software TPM server.
  2690. To create a TPM emulator backend device with chardev socket backend:
  2691. ::
  2692. -chardev socket,id=chrtpm,path=/tmp/swtpm-sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
  2693. ERST
  2694. DEFHEADING()
  2695. #endif
  2696. DEFHEADING(Linux/Multiboot boot specific:)
  2697. SRST
  2698. When using these options, you can use a given Linux or Multiboot kernel
  2699. without installing it in the disk image. It can be useful for easier
  2700. testing of various kernels.
  2701. ERST
  2702. DEF("kernel", HAS_ARG, QEMU_OPTION_kernel, \
  2703. "-kernel bzImage use 'bzImage' as kernel image\n", QEMU_ARCH_ALL)
  2704. SRST
  2705. ``-kernel bzImage``
  2706. Use bzImage as kernel image. The kernel can be either a Linux kernel
  2707. or in multiboot format.
  2708. ERST
  2709. DEF("append", HAS_ARG, QEMU_OPTION_append, \
  2710. "-append cmdline use 'cmdline' as kernel command line\n", QEMU_ARCH_ALL)
  2711. SRST
  2712. ``-append cmdline``
  2713. Use cmdline as kernel command line
  2714. ERST
  2715. DEF("initrd", HAS_ARG, QEMU_OPTION_initrd, \
  2716. "-initrd file use 'file' as initial ram disk\n", QEMU_ARCH_ALL)
  2717. SRST
  2718. ``-initrd file``
  2719. Use file as initial ram disk.
  2720. ``-initrd "file1 arg=foo,file2"``
  2721. This syntax is only available with multiboot.
  2722. Use file1 and file2 as modules and pass arg=foo as parameter to the
  2723. first module.
  2724. ERST
  2725. DEF("dtb", HAS_ARG, QEMU_OPTION_dtb, \
  2726. "-dtb file use 'file' as device tree image\n", QEMU_ARCH_ALL)
  2727. SRST
  2728. ``-dtb file``
  2729. Use file as a device tree binary (dtb) image and pass it to the
  2730. kernel on boot.
  2731. ERST
  2732. DEFHEADING()
  2733. DEFHEADING(Debug/Expert options:)
  2734. DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
  2735. "-fw_cfg [name=]<name>,file=<file>\n"
  2736. " add named fw_cfg entry with contents from file\n"
  2737. "-fw_cfg [name=]<name>,string=<str>\n"
  2738. " add named fw_cfg entry with contents from string\n",
  2739. QEMU_ARCH_ALL)
  2740. SRST
  2741. ``-fw_cfg [name=]name,file=file``
  2742. Add named fw\_cfg entry with contents from file file.
  2743. ``-fw_cfg [name=]name,string=str``
  2744. Add named fw\_cfg entry with contents from string str.
  2745. The terminating NUL character of the contents of str will not be
  2746. included as part of the fw\_cfg item data. To insert contents with
  2747. embedded NUL characters, you have to use the file parameter.
  2748. The fw\_cfg entries are passed by QEMU through to the guest.
  2749. Example:
  2750. ::
  2751. -fw_cfg name=opt/com.mycompany/blob,file=./my_blob.bin
  2752. creates an fw\_cfg entry named opt/com.mycompany/blob with contents
  2753. from ./my\_blob.bin.
  2754. ERST
  2755. DEF("serial", HAS_ARG, QEMU_OPTION_serial, \
  2756. "-serial dev redirect the serial port to char device 'dev'\n",
  2757. QEMU_ARCH_ALL)
  2758. SRST
  2759. ``-serial dev``
  2760. Redirect the virtual serial port to host character device dev. The
  2761. default device is ``vc`` in graphical mode and ``stdio`` in non
  2762. graphical mode.
  2763. This option can be used several times to simulate up to 4 serial
  2764. ports.
  2765. Use ``-serial none`` to disable all serial ports.
  2766. Available character devices are:
  2767. ``vc[:WxH]``
  2768. Virtual console. Optionally, a width and height can be given in
  2769. pixel with
  2770. ::
  2771. vc:800x600
  2772. It is also possible to specify width or height in characters:
  2773. ::
  2774. vc:80Cx24C
  2775. ``pty``
  2776. [Linux only] Pseudo TTY (a new PTY is automatically allocated)
  2777. ``none``
  2778. No device is allocated.
  2779. ``null``
  2780. void device
  2781. ``chardev:id``
  2782. Use a named character device defined with the ``-chardev``
  2783. option.
  2784. ``/dev/XXX``
  2785. [Linux only] Use host tty, e.g. ``/dev/ttyS0``. The host serial
  2786. port parameters are set according to the emulated ones.
  2787. ``/dev/parportN``
  2788. [Linux only, parallel port only] Use host parallel port N.
  2789. Currently SPP and EPP parallel port features can be used.
  2790. ``file:filename``
  2791. Write output to filename. No character can be read.
  2792. ``stdio``
  2793. [Unix only] standard input/output
  2794. ``pipe:filename``
  2795. name pipe filename
  2796. ``COMn``
  2797. [Windows only] Use host serial port n
  2798. ``udp:[remote_host]:remote_port[@[src_ip]:src_port]``
  2799. This implements UDP Net Console. When remote\_host or src\_ip
  2800. are not specified they default to ``0.0.0.0``. When not using a
  2801. specified src\_port a random port is automatically chosen.
  2802. If you just want a simple readonly console you can use
  2803. ``netcat`` or ``nc``, by starting QEMU with:
  2804. ``-serial udp::4555`` and nc as: ``nc -u -l -p 4555``. Any time
  2805. QEMU writes something to that port it will appear in the
  2806. netconsole session.
  2807. If you plan to send characters back via netconsole or you want
  2808. to stop and start QEMU a lot of times, you should have QEMU use
  2809. the same source port each time by using something like ``-serial
  2810. udp::4555@:4556`` to QEMU. Another approach is to use a patched
  2811. version of netcat which can listen to a TCP port and send and
  2812. receive characters via udp. If you have a patched version of
  2813. netcat which activates telnet remote echo and single char
  2814. transfer, then you can use the following options to set up a
  2815. netcat redirector to allow telnet on port 5555 to access the
  2816. QEMU port.
  2817. ``QEMU Options:``
  2818. -serial udp::4555@:4556
  2819. ``netcat options:``
  2820. -u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T
  2821. ``telnet options:``
  2822. localhost 5555
  2823. ``tcp:[host]:port[,server][,nowait][,nodelay][,reconnect=seconds]``
  2824. The TCP Net Console has two modes of operation. It can send the
  2825. serial I/O to a location or wait for a connection from a
  2826. location. By default the TCP Net Console is sent to host at the
  2827. port. If you use the server option QEMU will wait for a client
  2828. socket application to connect to the port before continuing,
  2829. unless the ``nowait`` option was specified. The ``nodelay``
  2830. option disables the Nagle buffering algorithm. The ``reconnect``
  2831. option only applies if noserver is set, if the connection goes
  2832. down it will attempt to reconnect at the given interval. If host
  2833. is omitted, 0.0.0.0 is assumed. Only one TCP connection at a
  2834. time is accepted. You can use ``telnet`` to connect to the
  2835. corresponding character device.
  2836. ``Example to send tcp console to 192.168.0.2 port 4444``
  2837. -serial tcp:192.168.0.2:4444
  2838. ``Example to listen and wait on port 4444 for connection``
  2839. -serial tcp::4444,server
  2840. ``Example to not wait and listen on ip 192.168.0.100 port 4444``
  2841. -serial tcp:192.168.0.100:4444,server,nowait
  2842. ``telnet:host:port[,server][,nowait][,nodelay]``
  2843. The telnet protocol is used instead of raw tcp sockets. The
  2844. options work the same as if you had specified ``-serial tcp``.
  2845. The difference is that the port acts like a telnet server or
  2846. client using telnet option negotiation. This will also allow you
  2847. to send the MAGIC\_SYSRQ sequence if you use a telnet that
  2848. supports sending the break sequence. Typically in unix telnet
  2849. you do it with Control-] and then type "send break" followed by
  2850. pressing the enter key.
  2851. ``websocket:host:port,server[,nowait][,nodelay]``
  2852. The WebSocket protocol is used instead of raw tcp socket. The
  2853. port acts as a WebSocket server. Client mode is not supported.
  2854. ``unix:path[,server][,nowait][,reconnect=seconds]``
  2855. A unix domain socket is used instead of a tcp socket. The option
  2856. works the same as if you had specified ``-serial tcp`` except
  2857. the unix domain socket path is used for connections.
  2858. ``mon:dev_string``
  2859. This is a special option to allow the monitor to be multiplexed
  2860. onto another serial port. The monitor is accessed with key
  2861. sequence of Control-a and then pressing c. dev\_string should be
  2862. any one of the serial devices specified above. An example to
  2863. multiplex the monitor onto a telnet server listening on port
  2864. 4444 would be:
  2865. ``-serial mon:telnet::4444,server,nowait``
  2866. When the monitor is multiplexed to stdio in this way, Ctrl+C
  2867. will not terminate QEMU any more but will be passed to the guest
  2868. instead.
  2869. ``braille``
  2870. Braille device. This will use BrlAPI to display the braille
  2871. output on a real or fake device.
  2872. ``msmouse``
  2873. Three button serial mouse. Configure the guest to use Microsoft
  2874. protocol.
  2875. ERST
  2876. DEF("parallel", HAS_ARG, QEMU_OPTION_parallel, \
  2877. "-parallel dev redirect the parallel port to char device 'dev'\n",
  2878. QEMU_ARCH_ALL)
  2879. SRST
  2880. ``-parallel dev``
  2881. Redirect the virtual parallel port to host device dev (same devices
  2882. as the serial port). On Linux hosts, ``/dev/parportN`` can be used
  2883. to use hardware devices connected on the corresponding host parallel
  2884. port.
  2885. This option can be used several times to simulate up to 3 parallel
  2886. ports.
  2887. Use ``-parallel none`` to disable all parallel ports.
  2888. ERST
  2889. DEF("monitor", HAS_ARG, QEMU_OPTION_monitor, \
  2890. "-monitor dev redirect the monitor to char device 'dev'\n",
  2891. QEMU_ARCH_ALL)
  2892. SRST
  2893. ``-monitor dev``
  2894. Redirect the monitor to host device dev (same devices as the serial
  2895. port). The default device is ``vc`` in graphical mode and ``stdio``
  2896. in non graphical mode. Use ``-monitor none`` to disable the default
  2897. monitor.
  2898. ERST
  2899. DEF("qmp", HAS_ARG, QEMU_OPTION_qmp, \
  2900. "-qmp dev like -monitor but opens in 'control' mode\n",
  2901. QEMU_ARCH_ALL)
  2902. SRST
  2903. ``-qmp dev``
  2904. Like -monitor but opens in 'control' mode.
  2905. ERST
  2906. DEF("qmp-pretty", HAS_ARG, QEMU_OPTION_qmp_pretty, \
  2907. "-qmp-pretty dev like -qmp but uses pretty JSON formatting\n",
  2908. QEMU_ARCH_ALL)
  2909. SRST
  2910. ``-qmp-pretty dev``
  2911. Like -qmp but uses pretty JSON formatting.
  2912. ERST
  2913. DEF("mon", HAS_ARG, QEMU_OPTION_mon, \
  2914. "-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]\n", QEMU_ARCH_ALL)
  2915. SRST
  2916. ``-mon [chardev=]name[,mode=readline|control][,pretty[=on|off]]``
  2917. Setup monitor on chardev name. ``pretty`` turns on JSON pretty
  2918. printing easing human reading and debugging.
  2919. ERST
  2920. DEF("debugcon", HAS_ARG, QEMU_OPTION_debugcon, \
  2921. "-debugcon dev redirect the debug console to char device 'dev'\n",
  2922. QEMU_ARCH_ALL)
  2923. SRST
  2924. ``-debugcon dev``
  2925. Redirect the debug console to host device dev (same devices as the
  2926. serial port). The debug console is an I/O port which is typically
  2927. port 0xe9; writing to that I/O port sends output to this device. The
  2928. default device is ``vc`` in graphical mode and ``stdio`` in non
  2929. graphical mode.
  2930. ERST
  2931. DEF("pidfile", HAS_ARG, QEMU_OPTION_pidfile, \
  2932. "-pidfile file write PID to 'file'\n", QEMU_ARCH_ALL)
  2933. SRST
  2934. ``-pidfile file``
  2935. Store the QEMU process PID in file. It is useful if you launch QEMU
  2936. from a script.
  2937. ERST
  2938. DEF("singlestep", 0, QEMU_OPTION_singlestep, \
  2939. "-singlestep always run in singlestep mode\n", QEMU_ARCH_ALL)
  2940. SRST
  2941. ``-singlestep``
  2942. Run the emulation in single step mode.
  2943. ERST
  2944. DEF("preconfig", 0, QEMU_OPTION_preconfig, \
  2945. "--preconfig pause QEMU before machine is initialized (experimental)\n",
  2946. QEMU_ARCH_ALL)
  2947. SRST
  2948. ``--preconfig``
  2949. Pause QEMU for interactive configuration before the machine is
  2950. created, which allows querying and configuring properties that will
  2951. affect machine initialization. Use QMP command 'x-exit-preconfig' to
  2952. exit the preconfig state and move to the next state (i.e. run guest
  2953. if -S isn't used or pause the second time if -S is used). This
  2954. option is experimental.
  2955. ERST
  2956. DEF("S", 0, QEMU_OPTION_S, \
  2957. "-S freeze CPU at startup (use 'c' to start execution)\n",
  2958. QEMU_ARCH_ALL)
  2959. SRST
  2960. ``-S``
  2961. Do not start CPU at startup (you must type 'c' in the monitor).
  2962. ERST
  2963. DEF("realtime", HAS_ARG, QEMU_OPTION_realtime,
  2964. "-realtime [mlock=on|off]\n"
  2965. " run qemu with realtime features\n"
  2966. " mlock=on|off controls mlock support (default: on)\n",
  2967. QEMU_ARCH_ALL)
  2968. SRST
  2969. ``-realtime mlock=on|off``
  2970. Run qemu with realtime features. mlocking qemu and guest memory can
  2971. be enabled via ``mlock=on`` (enabled by default).
  2972. ERST
  2973. DEF("overcommit", HAS_ARG, QEMU_OPTION_overcommit,
  2974. "-overcommit [mem-lock=on|off][cpu-pm=on|off]\n"
  2975. " run qemu with overcommit hints\n"
  2976. " mem-lock=on|off controls memory lock support (default: off)\n"
  2977. " cpu-pm=on|off controls cpu power management (default: off)\n",
  2978. QEMU_ARCH_ALL)
  2979. SRST
  2980. ``-overcommit mem-lock=on|off``
  2981. \
  2982. ``-overcommit cpu-pm=on|off``
  2983. Run qemu with hints about host resource overcommit. The default is
  2984. to assume that host overcommits all resources.
  2985. Locking qemu and guest memory can be enabled via ``mem-lock=on``
  2986. (disabled by default). This works when host memory is not
  2987. overcommitted and reduces the worst-case latency for guest. This is
  2988. equivalent to ``realtime``.
  2989. Guest ability to manage power state of host cpus (increasing latency
  2990. for other processes on the same host cpu, but decreasing latency for
  2991. guest) can be enabled via ``cpu-pm=on`` (disabled by default). This
  2992. works best when host CPU is not overcommitted. When used, host
  2993. estimates of CPU cycle and power utilization will be incorrect, not
  2994. taking into account guest idle time.
  2995. ERST
  2996. DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \
  2997. "-gdb dev accept gdb connection on 'dev'. (QEMU defaults to starting\n"
  2998. " the guest without waiting for gdb to connect; use -S too\n"
  2999. " if you want it to not start execution.)\n",
  3000. QEMU_ARCH_ALL)
  3001. SRST
  3002. ``-gdb dev``
  3003. Accept a gdb connection on device dev (see
  3004. :ref:`gdb_005fusage`). Note that this option does not pause QEMU
  3005. execution -- if you want QEMU to not start the guest until you
  3006. connect with gdb and issue a ``continue`` command, you will need to
  3007. also pass the ``-S`` option to QEMU.
  3008. The most usual configuration is to listen on a local TCP socket::
  3009. -gdb tcp::3117
  3010. but you can specify other backends; UDP, pseudo TTY, or even stdio
  3011. are all reasonable use cases. For example, a stdio connection
  3012. allows you to start QEMU from within gdb and establish the
  3013. connection via a pipe:
  3014. .. parsed-literal::
  3015. (gdb) target remote | exec |qemu_system| -gdb stdio ...
  3016. ERST
  3017. DEF("s", 0, QEMU_OPTION_s, \
  3018. "-s shorthand for -gdb tcp::" DEFAULT_GDBSTUB_PORT "\n",
  3019. QEMU_ARCH_ALL)
  3020. SRST
  3021. ``-s``
  3022. Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234
  3023. (see :ref:`gdb_005fusage`).
  3024. ERST
  3025. DEF("d", HAS_ARG, QEMU_OPTION_d, \
  3026. "-d item1,... enable logging of specified items (use '-d help' for a list of log items)\n",
  3027. QEMU_ARCH_ALL)
  3028. SRST
  3029. ``-d item1[,...]``
  3030. Enable logging of specified items. Use '-d help' for a list of log
  3031. items.
  3032. ERST
  3033. DEF("D", HAS_ARG, QEMU_OPTION_D, \
  3034. "-D logfile output log to logfile (default stderr)\n",
  3035. QEMU_ARCH_ALL)
  3036. SRST
  3037. ``-D logfile``
  3038. Output log in logfile instead of to stderr
  3039. ERST
  3040. DEF("dfilter", HAS_ARG, QEMU_OPTION_DFILTER, \
  3041. "-dfilter range,.. filter debug output to range of addresses (useful for -d cpu,exec,etc..)\n",
  3042. QEMU_ARCH_ALL)
  3043. SRST
  3044. ``-dfilter range1[,...]``
  3045. Filter debug output to that relevant to a range of target addresses.
  3046. The filter spec can be either start+size, start-size or start..end
  3047. where start end and size are the addresses and sizes required. For
  3048. example:
  3049. ::
  3050. -dfilter 0x8000..0x8fff,0xffffffc000080000+0x200,0xffffffc000060000-0x1000
  3051. Will dump output for any code in the 0x1000 sized block starting at
  3052. 0x8000 and the 0x200 sized block starting at 0xffffffc000080000 and
  3053. another 0x1000 sized block starting at 0xffffffc00005f000.
  3054. ERST
  3055. DEF("seed", HAS_ARG, QEMU_OPTION_seed, \
  3056. "-seed number seed the pseudo-random number generator\n",
  3057. QEMU_ARCH_ALL)
  3058. SRST
  3059. ``-seed number``
  3060. Force the guest to use a deterministic pseudo-random number
  3061. generator, seeded with number. This does not affect crypto routines
  3062. within the host.
  3063. ERST
  3064. DEF("L", HAS_ARG, QEMU_OPTION_L, \
  3065. "-L path set the directory for the BIOS, VGA BIOS and keymaps\n",
  3066. QEMU_ARCH_ALL)
  3067. SRST
  3068. ``-L path``
  3069. Set the directory for the BIOS, VGA BIOS and keymaps.
  3070. To list all the data directories, use ``-L help``.
  3071. ERST
  3072. DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
  3073. "-bios file set the filename for the BIOS\n", QEMU_ARCH_ALL)
  3074. SRST
  3075. ``-bios file``
  3076. Set the filename for the BIOS.
  3077. ERST
  3078. DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
  3079. "-enable-kvm enable KVM full virtualization support\n", QEMU_ARCH_ALL)
  3080. SRST
  3081. ``-enable-kvm``
  3082. Enable KVM full virtualization support. This option is only
  3083. available if KVM support is enabled when compiling.
  3084. ERST
  3085. DEF("xen-domid", HAS_ARG, QEMU_OPTION_xen_domid,
  3086. "-xen-domid id specify xen guest domain id\n", QEMU_ARCH_ALL)
  3087. DEF("xen-attach", 0, QEMU_OPTION_xen_attach,
  3088. "-xen-attach attach to existing xen domain\n"
  3089. " libxl will use this when starting QEMU\n",
  3090. QEMU_ARCH_ALL)
  3091. DEF("xen-domid-restrict", 0, QEMU_OPTION_xen_domid_restrict,
  3092. "-xen-domid-restrict restrict set of available xen operations\n"
  3093. " to specified domain id. (Does not affect\n"
  3094. " xenpv machine type).\n",
  3095. QEMU_ARCH_ALL)
  3096. SRST
  3097. ``-xen-domid id``
  3098. Specify xen guest domain id (XEN only).
  3099. ``-xen-attach``
  3100. Attach to existing xen domain. libxl will use this when starting
  3101. QEMU (XEN only). Restrict set of available xen operations to
  3102. specified domain id (XEN only).
  3103. ERST
  3104. DEF("no-reboot", 0, QEMU_OPTION_no_reboot, \
  3105. "-no-reboot exit instead of rebooting\n", QEMU_ARCH_ALL)
  3106. SRST
  3107. ``-no-reboot``
  3108. Exit instead of rebooting.
  3109. ERST
  3110. DEF("no-shutdown", 0, QEMU_OPTION_no_shutdown, \
  3111. "-no-shutdown stop before shutdown\n", QEMU_ARCH_ALL)
  3112. SRST
  3113. ``-no-shutdown``
  3114. Don't exit QEMU on guest shutdown, but instead only stop the
  3115. emulation. This allows for instance switching to monitor to commit
  3116. changes to the disk image.
  3117. ERST
  3118. DEF("loadvm", HAS_ARG, QEMU_OPTION_loadvm, \
  3119. "-loadvm [tag|id]\n" \
  3120. " start right away with a saved state (loadvm in monitor)\n",
  3121. QEMU_ARCH_ALL)
  3122. SRST
  3123. ``-loadvm file``
  3124. Start right away with a saved state (``loadvm`` in monitor)
  3125. ERST
  3126. #ifndef _WIN32
  3127. DEF("daemonize", 0, QEMU_OPTION_daemonize, \
  3128. "-daemonize daemonize QEMU after initializing\n", QEMU_ARCH_ALL)
  3129. #endif
  3130. SRST
  3131. ``-daemonize``
  3132. Daemonize the QEMU process after initialization. QEMU will not
  3133. detach from standard IO until it is ready to receive connections on
  3134. any of its devices. This option is a useful way for external
  3135. programs to launch QEMU without having to cope with initialization
  3136. race conditions.
  3137. ERST
  3138. DEF("option-rom", HAS_ARG, QEMU_OPTION_option_rom, \
  3139. "-option-rom rom load a file, rom, into the option ROM space\n",
  3140. QEMU_ARCH_ALL)
  3141. SRST
  3142. ``-option-rom file``
  3143. Load the contents of file as an option ROM. This option is useful to
  3144. load things like EtherBoot.
  3145. ERST
  3146. DEF("rtc", HAS_ARG, QEMU_OPTION_rtc, \
  3147. "-rtc [base=utc|localtime|<datetime>][,clock=host|rt|vm][,driftfix=none|slew]\n" \
  3148. " set the RTC base and clock, enable drift fix for clock ticks (x86 only)\n",
  3149. QEMU_ARCH_ALL)
  3150. SRST
  3151. ``-rtc [base=utc|localtime|datetime][,clock=host|rt|vm][,driftfix=none|slew]``
  3152. Specify ``base`` as ``utc`` or ``localtime`` to let the RTC start at
  3153. the current UTC or local time, respectively. ``localtime`` is
  3154. required for correct date in MS-DOS or Windows. To start at a
  3155. specific point in time, provide datetime in the format
  3156. ``2006-06-17T16:01:21`` or ``2006-06-17``. The default base is UTC.
  3157. By default the RTC is driven by the host system time. This allows
  3158. using of the RTC as accurate reference clock inside the guest,
  3159. specifically if the host time is smoothly following an accurate
  3160. external reference clock, e.g. via NTP. If you want to isolate the
  3161. guest time from the host, you can set ``clock`` to ``rt`` instead,
  3162. which provides a host monotonic clock if host support it. To even
  3163. prevent the RTC from progressing during suspension, you can set
  3164. ``clock`` to ``vm`` (virtual clock). '\ ``clock=vm``\ ' is
  3165. recommended especially in icount mode in order to preserve
  3166. determinism; however, note that in icount mode the speed of the
  3167. virtual clock is variable and can in general differ from the host
  3168. clock.
  3169. Enable ``driftfix`` (i386 targets only) if you experience time drift
  3170. problems, specifically with Windows' ACPI HAL. This option will try
  3171. to figure out how many timer interrupts were not processed by the
  3172. Windows guest and will re-inject them.
  3173. ERST
  3174. DEF("icount", HAS_ARG, QEMU_OPTION_icount, \
  3175. "-icount [shift=N|auto][,align=on|off][,sleep=on|off,rr=record|replay,rrfile=<filename>,rrsnapshot=<snapshot>]\n" \
  3176. " enable virtual instruction counter with 2^N clock ticks per\n" \
  3177. " instruction, enable aligning the host and virtual clocks\n" \
  3178. " or disable real time cpu sleeping\n", QEMU_ARCH_ALL)
  3179. SRST
  3180. ``-icount [shift=N|auto][,rr=record|replay,rrfile=filename,rrsnapshot=snapshot]``
  3181. Enable virtual instruction counter. The virtual cpu will execute one
  3182. instruction every 2^N ns of virtual time. If ``auto`` is specified
  3183. then the virtual cpu speed will be automatically adjusted to keep
  3184. virtual time within a few seconds of real time.
  3185. When the virtual cpu is sleeping, the virtual time will advance at
  3186. default speed unless ``sleep=on|off`` is specified. With
  3187. ``sleep=on|off``, the virtual time will jump to the next timer
  3188. deadline instantly whenever the virtual cpu goes to sleep mode and
  3189. will not advance if no timer is enabled. This behavior give
  3190. deterministic execution times from the guest point of view.
  3191. Note that while this option can give deterministic behavior, it does
  3192. not provide cycle accurate emulation. Modern CPUs contain
  3193. superscalar out of order cores with complex cache hierarchies. The
  3194. number of instructions executed often has little or no correlation
  3195. with actual performance.
  3196. ``align=on`` will activate the delay algorithm which will try to
  3197. synchronise the host clock and the virtual clock. The goal is to
  3198. have a guest running at the real frequency imposed by the shift
  3199. option. Whenever the guest clock is behind the host clock and if
  3200. ``align=on`` is specified then we print a message to the user to
  3201. inform about the delay. Currently this option does not work when
  3202. ``shift`` is ``auto``. Note: The sync algorithm will work for those
  3203. shift values for which the guest clock runs ahead of the host clock.
  3204. Typically this happens when the shift value is high (how high
  3205. depends on the host machine).
  3206. When ``rr`` option is specified deterministic record/replay is
  3207. enabled. Replay log is written into filename file in record mode and
  3208. read from this file in replay mode.
  3209. Option rrsnapshot is used to create new vm snapshot named snapshot
  3210. at the start of execution recording. In replay mode this option is
  3211. used to load the initial VM state.
  3212. ERST
  3213. DEF("watchdog", HAS_ARG, QEMU_OPTION_watchdog, \
  3214. "-watchdog model\n" \
  3215. " enable virtual hardware watchdog [default=none]\n",
  3216. QEMU_ARCH_ALL)
  3217. SRST
  3218. ``-watchdog model``
  3219. Create a virtual hardware watchdog device. Once enabled (by a guest
  3220. action), the watchdog must be periodically polled by an agent inside
  3221. the guest or else the guest will be restarted. Choose a model for
  3222. which your guest has drivers.
  3223. The model is the model of hardware watchdog to emulate. Use
  3224. ``-watchdog help`` to list available hardware models. Only one
  3225. watchdog can be enabled for a guest.
  3226. The following models may be available:
  3227. ``ib700``
  3228. iBASE 700 is a very simple ISA watchdog with a single timer.
  3229. ``i6300esb``
  3230. Intel 6300ESB I/O controller hub is a much more featureful
  3231. PCI-based dual-timer watchdog.
  3232. ``diag288``
  3233. A virtual watchdog for s390x backed by the diagnose 288
  3234. hypercall (currently KVM only).
  3235. ERST
  3236. DEF("watchdog-action", HAS_ARG, QEMU_OPTION_watchdog_action, \
  3237. "-watchdog-action reset|shutdown|poweroff|inject-nmi|pause|debug|none\n" \
  3238. " action when watchdog fires [default=reset]\n",
  3239. QEMU_ARCH_ALL)
  3240. SRST
  3241. ``-watchdog-action action``
  3242. The action controls what QEMU will do when the watchdog timer
  3243. expires. The default is ``reset`` (forcefully reset the guest).
  3244. Other possible actions are: ``shutdown`` (attempt to gracefully
  3245. shutdown the guest), ``poweroff`` (forcefully poweroff the guest),
  3246. ``inject-nmi`` (inject a NMI into the guest), ``pause`` (pause the
  3247. guest), ``debug`` (print a debug message and continue), or ``none``
  3248. (do nothing).
  3249. Note that the ``shutdown`` action requires that the guest responds
  3250. to ACPI signals, which it may not be able to do in the sort of
  3251. situations where the watchdog would have expired, and thus
  3252. ``-watchdog-action shutdown`` is not recommended for production use.
  3253. Examples:
  3254. ``-watchdog i6300esb -watchdog-action pause``; \ ``-watchdog ib700``
  3255. ERST
  3256. DEF("echr", HAS_ARG, QEMU_OPTION_echr, \
  3257. "-echr chr set terminal escape character instead of ctrl-a\n",
  3258. QEMU_ARCH_ALL)
  3259. SRST
  3260. ``-echr numeric_ascii_value``
  3261. Change the escape character used for switching to the monitor when
  3262. using monitor and serial sharing. The default is ``0x01`` when using
  3263. the ``-nographic`` option. ``0x01`` is equal to pressing
  3264. ``Control-a``. You can select a different character from the ascii
  3265. control keys where 1 through 26 map to Control-a through Control-z.
  3266. For instance you could use the either of the following to change the
  3267. escape character to Control-t.
  3268. ``-echr 0x14``; \ ``-echr 20``
  3269. ERST
  3270. DEF("show-cursor", 0, QEMU_OPTION_show_cursor, \
  3271. "-show-cursor show cursor\n", QEMU_ARCH_ALL)
  3272. SRST
  3273. ``-show-cursor``
  3274. Show cursor.
  3275. ERST
  3276. DEF("tb-size", HAS_ARG, QEMU_OPTION_tb_size, \
  3277. "-tb-size n set TB size\n", QEMU_ARCH_ALL)
  3278. SRST
  3279. ``-tb-size n``
  3280. Set TCG translation block cache size. Deprecated, use
  3281. '\ ``-accel tcg,tb-size=n``\ ' instead.
  3282. ERST
  3283. DEF("incoming", HAS_ARG, QEMU_OPTION_incoming, \
  3284. "-incoming tcp:[host]:port[,to=maxport][,ipv4][,ipv6]\n" \
  3285. "-incoming rdma:host:port[,ipv4][,ipv6]\n" \
  3286. "-incoming unix:socketpath\n" \
  3287. " prepare for incoming migration, listen on\n" \
  3288. " specified protocol and socket address\n" \
  3289. "-incoming fd:fd\n" \
  3290. "-incoming exec:cmdline\n" \
  3291. " accept incoming migration on given file descriptor\n" \
  3292. " or from given external command\n" \
  3293. "-incoming defer\n" \
  3294. " wait for the URI to be specified via migrate_incoming\n",
  3295. QEMU_ARCH_ALL)
  3296. SRST
  3297. ``-incoming tcp:[host]:port[,to=maxport][,ipv4][,ipv6]``
  3298. \
  3299. ``-incoming rdma:host:port[,ipv4][,ipv6]``
  3300. Prepare for incoming migration, listen on a given tcp port.
  3301. ``-incoming unix:socketpath``
  3302. Prepare for incoming migration, listen on a given unix socket.
  3303. ``-incoming fd:fd``
  3304. Accept incoming migration from a given filedescriptor.
  3305. ``-incoming exec:cmdline``
  3306. Accept incoming migration as an output from specified external
  3307. command.
  3308. ``-incoming defer``
  3309. Wait for the URI to be specified via migrate\_incoming. The monitor
  3310. can be used to change settings (such as migration parameters) prior
  3311. to issuing the migrate\_incoming to allow the migration to begin.
  3312. ERST
  3313. DEF("only-migratable", 0, QEMU_OPTION_only_migratable, \
  3314. "-only-migratable allow only migratable devices\n", QEMU_ARCH_ALL)
  3315. SRST
  3316. ``-only-migratable``
  3317. Only allow migratable devices. Devices will not be allowed to enter
  3318. an unmigratable state.
  3319. ERST
  3320. DEF("nodefaults", 0, QEMU_OPTION_nodefaults, \
  3321. "-nodefaults don't create default devices\n", QEMU_ARCH_ALL)
  3322. SRST
  3323. ``-nodefaults``
  3324. Don't create default devices. Normally, QEMU sets the default
  3325. devices like serial port, parallel port, virtual console, monitor
  3326. device, VGA adapter, floppy and CD-ROM drive and others. The
  3327. ``-nodefaults`` option will disable all those default devices.
  3328. ERST
  3329. #ifndef _WIN32
  3330. DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \
  3331. "-chroot dir chroot to dir just before starting the VM\n",
  3332. QEMU_ARCH_ALL)
  3333. #endif
  3334. SRST
  3335. ``-chroot dir``
  3336. Immediately before starting guest execution, chroot to the specified
  3337. directory. Especially useful in combination with -runas.
  3338. ERST
  3339. #ifndef _WIN32
  3340. DEF("runas", HAS_ARG, QEMU_OPTION_runas, \
  3341. "-runas user change to user id user just before starting the VM\n" \
  3342. " user can be numeric uid:gid instead\n",
  3343. QEMU_ARCH_ALL)
  3344. #endif
  3345. SRST
  3346. ``-runas user``
  3347. Immediately before starting guest execution, drop root privileges,
  3348. switching to the specified user.
  3349. ERST
  3350. DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env,
  3351. "-prom-env variable=value\n"
  3352. " set OpenBIOS nvram variables\n",
  3353. QEMU_ARCH_PPC | QEMU_ARCH_SPARC)
  3354. SRST
  3355. ``-prom-env variable=value``
  3356. Set OpenBIOS nvram variable to given value (PPC, SPARC only).
  3357. ::
  3358. qemu-system-sparc -prom-env 'auto-boot?=false' \
  3359. -prom-env 'boot-device=sd(0,2,0):d' -prom-env 'boot-args=linux single'
  3360. ::
  3361. qemu-system-ppc -prom-env 'auto-boot?=false' \
  3362. -prom-env 'boot-device=hd:2,\yaboot' \
  3363. -prom-env 'boot-args=conf=hd:2,\yaboot.conf'
  3364. ERST
  3365. DEF("semihosting", 0, QEMU_OPTION_semihosting,
  3366. "-semihosting semihosting mode\n",
  3367. QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
  3368. QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2)
  3369. SRST
  3370. ``-semihosting``
  3371. Enable semihosting mode (ARM, M68K, Xtensa, MIPS, Nios II only).
  3372. Note that this allows guest direct access to the host filesystem, so
  3373. should only be used with a trusted guest OS.
  3374. See the -semihosting-config option documentation for further
  3375. information about the facilities this enables.
  3376. ERST
  3377. DEF("semihosting-config", HAS_ARG, QEMU_OPTION_semihosting_config,
  3378. "-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]\n" \
  3379. " semihosting configuration\n",
  3380. QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_LM32 |
  3381. QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2)
  3382. SRST
  3383. ``-semihosting-config [enable=on|off][,target=native|gdb|auto][,chardev=id][,arg=str[,...]]``
  3384. Enable and configure semihosting (ARM, M68K, Xtensa, MIPS, Nios II
  3385. only).
  3386. Note that this allows guest direct access to the host filesystem, so
  3387. should only be used with a trusted guest OS.
  3388. On Arm this implements the standard semihosting API, version 2.0.
  3389. On M68K this implements the "ColdFire GDB" interface used by
  3390. libgloss.
  3391. Xtensa semihosting provides basic file IO calls, such as
  3392. open/read/write/seek/select. Tensilica baremetal libc for ISS and
  3393. linux platform "sim" use this interface.
  3394. ``target=native|gdb|auto``
  3395. Defines where the semihosting calls will be addressed, to QEMU
  3396. (``native``) or to GDB (``gdb``). The default is ``auto``, which
  3397. means ``gdb`` during debug sessions and ``native`` otherwise.
  3398. ``chardev=str1``
  3399. Send the output to a chardev backend output for native or auto
  3400. output when not in gdb
  3401. ``arg=str1,arg=str2,...``
  3402. Allows the user to pass input arguments, and can be used
  3403. multiple times to build up a list. The old-style
  3404. ``-kernel``/``-append`` method of passing a command line is
  3405. still supported for backward compatibility. If both the
  3406. ``--semihosting-config arg`` and the ``-kernel``/``-append`` are
  3407. specified, the former is passed to semihosting as it always
  3408. takes precedence.
  3409. ERST
  3410. DEF("old-param", 0, QEMU_OPTION_old_param,
  3411. "-old-param old param mode\n", QEMU_ARCH_ARM)
  3412. SRST
  3413. ``-old-param``
  3414. Old param mode (ARM only).
  3415. ERST
  3416. DEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \
  3417. "-sandbox on[,obsolete=allow|deny][,elevateprivileges=allow|deny|children]\n" \
  3418. " [,spawn=allow|deny][,resourcecontrol=allow|deny]\n" \
  3419. " Enable seccomp mode 2 system call filter (default 'off').\n" \
  3420. " use 'obsolete' to allow obsolete system calls that are provided\n" \
  3421. " by the kernel, but typically no longer used by modern\n" \
  3422. " C library implementations.\n" \
  3423. " use 'elevateprivileges' to allow or deny QEMU process to elevate\n" \
  3424. " its privileges by blacklisting all set*uid|gid system calls.\n" \
  3425. " The value 'children' will deny set*uid|gid system calls for\n" \
  3426. " main QEMU process but will allow forks and execves to run unprivileged\n" \
  3427. " use 'spawn' to avoid QEMU to spawn new threads or processes by\n" \
  3428. " blacklisting *fork and execve\n" \
  3429. " use 'resourcecontrol' to disable process affinity and schedular priority\n",
  3430. QEMU_ARCH_ALL)
  3431. SRST
  3432. ``-sandbox arg[,obsolete=string][,elevateprivileges=string][,spawn=string][,resourcecontrol=string]``
  3433. Enable Seccomp mode 2 system call filter. 'on' will enable syscall
  3434. filtering and 'off' will disable it. The default is 'off'.
  3435. ``obsolete=string``
  3436. Enable Obsolete system calls
  3437. ``elevateprivileges=string``
  3438. Disable set\*uid\|gid system calls
  3439. ``spawn=string``
  3440. Disable \*fork and execve
  3441. ``resourcecontrol=string``
  3442. Disable process affinity and schedular priority
  3443. ERST
  3444. DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
  3445. "-readconfig <file>\n", QEMU_ARCH_ALL)
  3446. SRST
  3447. ``-readconfig file``
  3448. Read device configuration from file. This approach is useful when
  3449. you want to spawn QEMU process with many command line options but
  3450. you don't want to exceed the command line character limit.
  3451. ERST
  3452. DEF("writeconfig", HAS_ARG, QEMU_OPTION_writeconfig,
  3453. "-writeconfig <file>\n"
  3454. " read/write config file\n", QEMU_ARCH_ALL)
  3455. SRST
  3456. ``-writeconfig file``
  3457. Write device configuration to file. The file can be either filename
  3458. to save command line and device configuration into file or dash
  3459. ``-``) character to print the output to stdout. This can be later
  3460. used as input file for ``-readconfig`` option.
  3461. ERST
  3462. DEF("no-user-config", 0, QEMU_OPTION_nouserconfig,
  3463. "-no-user-config\n"
  3464. " do not load default user-provided config files at startup\n",
  3465. QEMU_ARCH_ALL)
  3466. SRST
  3467. ``-no-user-config``
  3468. The ``-no-user-config`` option makes QEMU not load any of the
  3469. user-provided config files on sysconfdir.
  3470. ERST
  3471. DEF("trace", HAS_ARG, QEMU_OPTION_trace,
  3472. "-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
  3473. " specify tracing options\n",
  3474. QEMU_ARCH_ALL)
  3475. SRST
  3476. ``-trace [[enable=]pattern][,events=file][,file=file]``
  3477. .. include:: ../qemu-option-trace.rst.inc
  3478. ERST
  3479. DEF("plugin", HAS_ARG, QEMU_OPTION_plugin,
  3480. "-plugin [file=]<file>[,arg=<string>]\n"
  3481. " load a plugin\n",
  3482. QEMU_ARCH_ALL)
  3483. SRST
  3484. ``-plugin file=file[,arg=string]``
  3485. Load a plugin.
  3486. ``file=file``
  3487. Load the given plugin from a shared library file.
  3488. ``arg=string``
  3489. Argument string passed to the plugin. (Can be given multiple
  3490. times.)
  3491. ERST
  3492. HXCOMM Internal use
  3493. DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL)
  3494. DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL)
  3495. #ifdef __linux__
  3496. DEF("enable-fips", 0, QEMU_OPTION_enablefips,
  3497. "-enable-fips enable FIPS 140-2 compliance\n",
  3498. QEMU_ARCH_ALL)
  3499. #endif
  3500. SRST
  3501. ``-enable-fips``
  3502. Enable FIPS 140-2 compliance mode.
  3503. ERST
  3504. HXCOMM Deprecated by -accel tcg
  3505. DEF("no-kvm", 0, QEMU_OPTION_no_kvm, "", QEMU_ARCH_I386)
  3506. DEF("msg", HAS_ARG, QEMU_OPTION_msg,
  3507. "-msg timestamp[=on|off]\n"
  3508. " control error message format\n"
  3509. " timestamp=on enables timestamps (default: off)\n",
  3510. QEMU_ARCH_ALL)
  3511. SRST
  3512. ``-msg timestamp[=on|off]``
  3513. Control error message format.
  3514. ``timestamp=on|off``
  3515. Prefix messages with a timestamp. Default is off.
  3516. ERST
  3517. DEF("dump-vmstate", HAS_ARG, QEMU_OPTION_dump_vmstate,
  3518. "-dump-vmstate <file>\n"
  3519. " Output vmstate information in JSON format to file.\n"
  3520. " Use the scripts/vmstate-static-checker.py file to\n"
  3521. " check for possible regressions in migration code\n"
  3522. " by comparing two such vmstate dumps.\n",
  3523. QEMU_ARCH_ALL)
  3524. SRST
  3525. ``-dump-vmstate file``
  3526. Dump json-encoded vmstate information for current machine type to
  3527. file in file
  3528. ERST
  3529. DEF("enable-sync-profile", 0, QEMU_OPTION_enable_sync_profile,
  3530. "-enable-sync-profile\n"
  3531. " enable synchronization profiling\n",
  3532. QEMU_ARCH_ALL)
  3533. SRST
  3534. ``-enable-sync-profile``
  3535. Enable synchronization profiling.
  3536. ERST
  3537. DEFHEADING()
  3538. DEFHEADING(Generic object creation:)
  3539. DEF("object", HAS_ARG, QEMU_OPTION_object,
  3540. "-object TYPENAME[,PROP1=VALUE1,...]\n"
  3541. " create a new object of type TYPENAME setting properties\n"
  3542. " in the order they are specified. Note that the 'id'\n"
  3543. " property must be set. These objects are placed in the\n"
  3544. " '/objects' path.\n",
  3545. QEMU_ARCH_ALL)
  3546. SRST
  3547. ``-object typename[,prop1=value1,...]``
  3548. Create a new object of type typename setting properties in the order
  3549. they are specified. Note that the 'id' property must be set. These
  3550. objects are placed in the '/objects' path.
  3551. ``-object memory-backend-file,id=id,size=size,mem-path=dir,share=on|off,discard-data=on|off,merge=on|off,dump=on|off,prealloc=on|off,host-nodes=host-nodes,policy=default|preferred|bind|interleave,align=align``
  3552. Creates a memory file backend object, which can be used to back
  3553. the guest RAM with huge pages.
  3554. The ``id`` parameter is a unique ID that will be used to
  3555. reference this memory region when configuring the ``-numa``
  3556. argument.
  3557. The ``size`` option provides the size of the memory region, and
  3558. accepts common suffixes, eg ``500M``.
  3559. The ``mem-path`` provides the path to either a shared memory or
  3560. huge page filesystem mount.
  3561. The ``share`` boolean option determines whether the memory
  3562. region is marked as private to QEMU, or shared. The latter
  3563. allows a co-operating external process to access the QEMU memory
  3564. region.
  3565. The ``share`` is also required for pvrdma devices due to
  3566. limitations in the RDMA API provided by Linux.
  3567. Setting share=on might affect the ability to configure NUMA
  3568. bindings for the memory backend under some circumstances, see
  3569. Documentation/vm/numa\_memory\_policy.txt on the Linux kernel
  3570. source tree for additional details.
  3571. Setting the ``discard-data`` boolean option to on indicates that
  3572. file contents can be destroyed when QEMU exits, to avoid
  3573. unnecessarily flushing data to the backing file. Note that
  3574. ``discard-data`` is only an optimization, and QEMU might not
  3575. discard file contents if it aborts unexpectedly or is terminated
  3576. using SIGKILL.
  3577. The ``merge`` boolean option enables memory merge, also known as
  3578. MADV\_MERGEABLE, so that Kernel Samepage Merging will consider
  3579. the pages for memory deduplication.
  3580. Setting the ``dump`` boolean option to off excludes the memory
  3581. from core dumps. This feature is also known as MADV\_DONTDUMP.
  3582. The ``prealloc`` boolean option enables memory preallocation.
  3583. The ``host-nodes`` option binds the memory range to a list of
  3584. NUMA host nodes.
  3585. The ``policy`` option sets the NUMA policy to one of the
  3586. following values:
  3587. ``default``
  3588. default host policy
  3589. ``preferred``
  3590. prefer the given host node list for allocation
  3591. ``bind``
  3592. restrict memory allocation to the given host node list
  3593. ``interleave``
  3594. interleave memory allocations across the given host node
  3595. list
  3596. The ``align`` option specifies the base address alignment when
  3597. QEMU mmap(2) ``mem-path``, and accepts common suffixes, eg
  3598. ``2M``. Some backend store specified by ``mem-path`` requires an
  3599. alignment different than the default one used by QEMU, eg the
  3600. device DAX /dev/dax0.0 requires 2M alignment rather than 4K. In
  3601. such cases, users can specify the required alignment via this
  3602. option.
  3603. The ``pmem`` option specifies whether the backing file specified
  3604. by ``mem-path`` is in host persistent memory that can be
  3605. accessed using the SNIA NVM programming model (e.g. Intel
  3606. NVDIMM). If ``pmem`` is set to 'on', QEMU will take necessary
  3607. operations to guarantee the persistence of its own writes to
  3608. ``mem-path`` (e.g. in vNVDIMM label emulation and live
  3609. migration). Also, we will map the backend-file with MAP\_SYNC
  3610. flag, which ensures the file metadata is in sync for
  3611. ``mem-path`` in case of host crash or a power failure. MAP\_SYNC
  3612. requires support from both the host kernel (since Linux kernel
  3613. 4.15) and the filesystem of ``mem-path`` mounted with DAX
  3614. option.
  3615. ``-object memory-backend-ram,id=id,merge=on|off,dump=on|off,share=on|off,prealloc=on|off,size=size,host-nodes=host-nodes,policy=default|preferred|bind|interleave``
  3616. Creates a memory backend object, which can be used to back the
  3617. guest RAM. Memory backend objects offer more control than the
  3618. ``-m`` option that is traditionally used to define guest RAM.
  3619. Please refer to ``memory-backend-file`` for a description of the
  3620. options.
  3621. ``-object memory-backend-memfd,id=id,merge=on|off,dump=on|off,share=on|off,prealloc=on|off,size=size,host-nodes=host-nodes,policy=default|preferred|bind|interleave,seal=on|off,hugetlb=on|off,hugetlbsize=size``
  3622. Creates an anonymous memory file backend object, which allows
  3623. QEMU to share the memory with an external process (e.g. when
  3624. using vhost-user). The memory is allocated with memfd and
  3625. optional sealing. (Linux only)
  3626. The ``seal`` option creates a sealed-file, that will block
  3627. further resizing the memory ('on' by default).
  3628. The ``hugetlb`` option specify the file to be created resides in
  3629. the hugetlbfs filesystem (since Linux 4.14). Used in conjunction
  3630. with the ``hugetlb`` option, the ``hugetlbsize`` option specify
  3631. the hugetlb page size on systems that support multiple hugetlb
  3632. page sizes (it must be a power of 2 value supported by the
  3633. system).
  3634. In some versions of Linux, the ``hugetlb`` option is
  3635. incompatible with the ``seal`` option (requires at least Linux
  3636. 4.16).
  3637. Please refer to ``memory-backend-file`` for a description of the
  3638. other options.
  3639. The ``share`` boolean option is on by default with memfd.
  3640. ``-object rng-builtin,id=id``
  3641. Creates a random number generator backend which obtains entropy
  3642. from QEMU builtin functions. The ``id`` parameter is a unique ID
  3643. that will be used to reference this entropy backend from the
  3644. ``virtio-rng`` device. By default, the ``virtio-rng`` device
  3645. uses this RNG backend.
  3646. ``-object rng-random,id=id,filename=/dev/random``
  3647. Creates a random number generator backend which obtains entropy
  3648. from a device on the host. The ``id`` parameter is a unique ID
  3649. that will be used to reference this entropy backend from the
  3650. ``virtio-rng`` device. The ``filename`` parameter specifies
  3651. which file to obtain entropy from and if omitted defaults to
  3652. ``/dev/urandom``.
  3653. ``-object rng-egd,id=id,chardev=chardevid``
  3654. Creates a random number generator backend which obtains entropy
  3655. from an external daemon running on the host. The ``id``
  3656. parameter is a unique ID that will be used to reference this
  3657. entropy backend from the ``virtio-rng`` device. The ``chardev``
  3658. parameter is the unique ID of a character device backend that
  3659. provides the connection to the RNG daemon.
  3660. ``-object tls-creds-anon,id=id,endpoint=endpoint,dir=/path/to/cred/dir,verify-peer=on|off``
  3661. Creates a TLS anonymous credentials object, which can be used to
  3662. provide TLS support on network backends. The ``id`` parameter is
  3663. a unique ID which network backends will use to access the
  3664. credentials. The ``endpoint`` is either ``server`` or ``client``
  3665. depending on whether the QEMU network backend that uses the
  3666. credentials will be acting as a client or as a server. If
  3667. ``verify-peer`` is enabled (the default) then once the handshake
  3668. is completed, the peer credentials will be verified, though this
  3669. is a no-op for anonymous credentials.
  3670. The dir parameter tells QEMU where to find the credential files.
  3671. For server endpoints, this directory may contain a file
  3672. dh-params.pem providing diffie-hellman parameters to use for the
  3673. TLS server. If the file is missing, QEMU will generate a set of
  3674. DH parameters at startup. This is a computationally expensive
  3675. operation that consumes random pool entropy, so it is
  3676. recommended that a persistent set of parameters be generated
  3677. upfront and saved.
  3678. ``-object tls-creds-psk,id=id,endpoint=endpoint,dir=/path/to/keys/dir[,username=username]``
  3679. Creates a TLS Pre-Shared Keys (PSK) credentials object, which
  3680. can be used to provide TLS support on network backends. The
  3681. ``id`` parameter is a unique ID which network backends will use
  3682. to access the credentials. The ``endpoint`` is either ``server``
  3683. or ``client`` depending on whether the QEMU network backend that
  3684. uses the credentials will be acting as a client or as a server.
  3685. For clients only, ``username`` is the username which will be
  3686. sent to the server. If omitted it defaults to "qemu".
  3687. The dir parameter tells QEMU where to find the keys file. It is
  3688. called "dir/keys.psk" and contains "username:key" pairs. This
  3689. file can most easily be created using the GnuTLS ``psktool``
  3690. program.
  3691. For server endpoints, dir may also contain a file dh-params.pem
  3692. providing diffie-hellman parameters to use for the TLS server.
  3693. If the file is missing, QEMU will generate a set of DH
  3694. parameters at startup. This is a computationally expensive
  3695. operation that consumes random pool entropy, so it is
  3696. recommended that a persistent set of parameters be generated up
  3697. front and saved.
  3698. ``-object tls-creds-x509,id=id,endpoint=endpoint,dir=/path/to/cred/dir,priority=priority,verify-peer=on|off,passwordid=id``
  3699. Creates a TLS anonymous credentials object, which can be used to
  3700. provide TLS support on network backends. The ``id`` parameter is
  3701. a unique ID which network backends will use to access the
  3702. credentials. The ``endpoint`` is either ``server`` or ``client``
  3703. depending on whether the QEMU network backend that uses the
  3704. credentials will be acting as a client or as a server. If
  3705. ``verify-peer`` is enabled (the default) then once the handshake
  3706. is completed, the peer credentials will be verified. With x509
  3707. certificates, this implies that the clients must be provided
  3708. with valid client certificates too.
  3709. The dir parameter tells QEMU where to find the credential files.
  3710. For server endpoints, this directory may contain a file
  3711. dh-params.pem providing diffie-hellman parameters to use for the
  3712. TLS server. If the file is missing, QEMU will generate a set of
  3713. DH parameters at startup. This is a computationally expensive
  3714. operation that consumes random pool entropy, so it is
  3715. recommended that a persistent set of parameters be generated
  3716. upfront and saved.
  3717. For x509 certificate credentials the directory will contain
  3718. further files providing the x509 certificates. The certificates
  3719. must be stored in PEM format, in filenames ca-cert.pem,
  3720. ca-crl.pem (optional), server-cert.pem (only servers),
  3721. server-key.pem (only servers), client-cert.pem (only clients),
  3722. and client-key.pem (only clients).
  3723. For the server-key.pem and client-key.pem files which contain
  3724. sensitive private keys, it is possible to use an encrypted
  3725. version by providing the passwordid parameter. This provides the
  3726. ID of a previously created ``secret`` object containing the
  3727. password for decryption.
  3728. The priority parameter allows to override the global default
  3729. priority used by gnutls. This can be useful if the system
  3730. administrator needs to use a weaker set of crypto priorities for
  3731. QEMU without potentially forcing the weakness onto all
  3732. applications. Or conversely if one wants wants a stronger
  3733. default for QEMU than for all other applications, they can do
  3734. this through this parameter. Its format is a gnutls priority
  3735. string as described at
  3736. https://gnutls.org/manual/html_node/Priority-Strings.html.
  3737. ``-object filter-buffer,id=id,netdev=netdevid,interval=t[,queue=all|rx|tx][,status=on|off][,position=head|tail|id=<id>][,insert=behind|before]``
  3738. Interval t can't be 0, this filter batches the packet delivery:
  3739. all packets arriving in a given interval on netdev netdevid are
  3740. delayed until the end of the interval. Interval is in
  3741. microseconds. ``status`` is optional that indicate whether the
  3742. netfilter is on (enabled) or off (disabled), the default status
  3743. for netfilter will be 'on'.
  3744. queue all\|rx\|tx is an option that can be applied to any
  3745. netfilter.
  3746. ``all``: the filter is attached both to the receive and the
  3747. transmit queue of the netdev (default).
  3748. ``rx``: the filter is attached to the receive queue of the
  3749. netdev, where it will receive packets sent to the netdev.
  3750. ``tx``: the filter is attached to the transmit queue of the
  3751. netdev, where it will receive packets sent by the netdev.
  3752. position head\|tail\|id=<id> is an option to specify where the
  3753. filter should be inserted in the filter list. It can be applied
  3754. to any netfilter.
  3755. ``head``: the filter is inserted at the head of the filter list,
  3756. before any existing filters.
  3757. ``tail``: the filter is inserted at the tail of the filter list,
  3758. behind any existing filters (default).
  3759. ``id=<id>``: the filter is inserted before or behind the filter
  3760. specified by <id>, see the insert option below.
  3761. insert behind\|before is an option to specify where to insert
  3762. the new filter relative to the one specified with
  3763. position=id=<id>. It can be applied to any netfilter.
  3764. ``before``: insert before the specified filter.
  3765. ``behind``: insert behind the specified filter (default).
  3766. ``-object filter-mirror,id=id,netdev=netdevid,outdev=chardevid,queue=all|rx|tx[,vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]``
  3767. filter-mirror on netdev netdevid,mirror net packet to
  3768. chardevchardevid, if it has the vnet\_hdr\_support flag,
  3769. filter-mirror will mirror packet with vnet\_hdr\_len.
  3770. ``-object filter-redirector,id=id,netdev=netdevid,indev=chardevid,outdev=chardevid,queue=all|rx|tx[,vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]``
  3771. filter-redirector on netdev netdevid,redirect filter's net
  3772. packet to chardev chardevid,and redirect indev's packet to
  3773. filter.if it has the vnet\_hdr\_support flag, filter-redirector
  3774. will redirect packet with vnet\_hdr\_len. Create a
  3775. filter-redirector we need to differ outdev id from indev id, id
  3776. can not be the same. we can just use indev or outdev, but at
  3777. least one of indev or outdev need to be specified.
  3778. ``-object filter-rewriter,id=id,netdev=netdevid,queue=all|rx|tx,[vnet_hdr_support][,position=head|tail|id=<id>][,insert=behind|before]``
  3779. Filter-rewriter is a part of COLO project.It will rewrite tcp
  3780. packet to secondary from primary to keep secondary tcp
  3781. connection,and rewrite tcp packet to primary from secondary make
  3782. tcp packet can be handled by client.if it has the
  3783. vnet\_hdr\_support flag, we can parse packet with vnet header.
  3784. usage: colo secondary: -object
  3785. filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0 -object
  3786. filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1 -object
  3787. filter-rewriter,id=rew0,netdev=hn0,queue=all
  3788. ``-object filter-dump,id=id,netdev=dev[,file=filename][,maxlen=len][,position=head|tail|id=<id>][,insert=behind|before]``
  3789. Dump the network traffic on netdev dev to the file specified by
  3790. filename. At most len bytes (64k by default) per packet are
  3791. stored. The file format is libpcap, so it can be analyzed with
  3792. tools such as tcpdump or Wireshark.
  3793. ``-object colo-compare,id=id,primary_in=chardevid,secondary_in=chardevid,outdev=chardevid,iothread=id[,vnet_hdr_support][,notify_dev=id][,compare_timeout=@var{ms}][,expired_scan_cycle=@var{ms}``
  3794. Colo-compare gets packet from primary\_inchardevid and
  3795. secondary\_inchardevid, than compare primary packet with
  3796. secondary packet. If the packets are same, we will output
  3797. primary packet to outdevchardevid, else we will notify
  3798. colo-frame do checkpoint and send primary packet to
  3799. outdevchardevid. In order to improve efficiency, we need to put
  3800. the task of comparison in another thread. If it has the
  3801. vnet\_hdr\_support flag, colo compare will send/recv packet with
  3802. vnet\_hdr\_len. Then compare\_timeout=@var{ms} determines the
  3803. maximum delay colo-compare wait for the packet.
  3804. The expired\_scan\_cycle=@var{ms} to set the period of scanning
  3805. expired primary node network packets.
  3806. If you want to use Xen COLO, will need the notify\_dev to
  3807. notify Xen colo-frame to do checkpoint.
  3808. we must use it with the help of filter-mirror and
  3809. filter-redirector.
  3810. ::
  3811. KVM COLO
  3812. primary:
  3813. -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
  3814. -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
  3815. -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
  3816. -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
  3817. -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
  3818. -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
  3819. -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
  3820. -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
  3821. -object iothread,id=iothread1
  3822. -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
  3823. -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
  3824. -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
  3825. -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,iothread=iothread1
  3826. secondary:
  3827. -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
  3828. -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
  3829. -chardev socket,id=red0,host=3.3.3.3,port=9003
  3830. -chardev socket,id=red1,host=3.3.3.3,port=9004
  3831. -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
  3832. -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
  3833. Xen COLO
  3834. primary:
  3835. -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
  3836. -device e1000,id=e0,netdev=hn0,mac=52:a4:00:12:78:66
  3837. -chardev socket,id=mirror0,host=3.3.3.3,port=9003,server,nowait
  3838. -chardev socket,id=compare1,host=3.3.3.3,port=9004,server,nowait
  3839. -chardev socket,id=compare0,host=3.3.3.3,port=9001,server,nowait
  3840. -chardev socket,id=compare0-0,host=3.3.3.3,port=9001
  3841. -chardev socket,id=compare_out,host=3.3.3.3,port=9005,server,nowait
  3842. -chardev socket,id=compare_out0,host=3.3.3.3,port=9005
  3843. -chardev socket,id=notify_way,host=3.3.3.3,port=9009,server,nowait
  3844. -object filter-mirror,id=m0,netdev=hn0,queue=tx,outdev=mirror0
  3845. -object filter-redirector,netdev=hn0,id=redire0,queue=rx,indev=compare_out
  3846. -object filter-redirector,netdev=hn0,id=redire1,queue=rx,outdev=compare0
  3847. -object iothread,id=iothread1
  3848. -object colo-compare,id=comp0,primary_in=compare0-0,secondary_in=compare1,outdev=compare_out0,notify_dev=nofity_way,iothread=iothread1
  3849. secondary:
  3850. -netdev tap,id=hn0,vhost=off,script=/etc/qemu-ifup,down script=/etc/qemu-ifdown
  3851. -device e1000,netdev=hn0,mac=52:a4:00:12:78:66
  3852. -chardev socket,id=red0,host=3.3.3.3,port=9003
  3853. -chardev socket,id=red1,host=3.3.3.3,port=9004
  3854. -object filter-redirector,id=f1,netdev=hn0,queue=tx,indev=red0
  3855. -object filter-redirector,id=f2,netdev=hn0,queue=rx,outdev=red1
  3856. If you want to know the detail of above command line, you can
  3857. read the colo-compare git log.
  3858. ``-object cryptodev-backend-builtin,id=id[,queues=queues]``
  3859. Creates a cryptodev backend which executes crypto opreation from
  3860. the QEMU cipher APIS. The id parameter is a unique ID that will
  3861. be used to reference this cryptodev backend from the
  3862. ``virtio-crypto`` device. The queues parameter is optional,
  3863. which specify the queue number of cryptodev backend, the default
  3864. of queues is 1.
  3865. .. parsed-literal::
  3866. # |qemu_system| \
  3867. [...] \
  3868. -object cryptodev-backend-builtin,id=cryptodev0 \
  3869. -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
  3870. [...]
  3871. ``-object cryptodev-vhost-user,id=id,chardev=chardevid[,queues=queues]``
  3872. Creates a vhost-user cryptodev backend, backed by a chardev
  3873. chardevid. The id parameter is a unique ID that will be used to
  3874. reference this cryptodev backend from the ``virtio-crypto``
  3875. device. The chardev should be a unix domain socket backed one.
  3876. The vhost-user uses a specifically defined protocol to pass
  3877. vhost ioctl replacement messages to an application on the other
  3878. end of the socket. The queues parameter is optional, which
  3879. specify the queue number of cryptodev backend for multiqueue
  3880. vhost-user, the default of queues is 1.
  3881. .. parsed-literal::
  3882. # |qemu_system| \
  3883. [...] \
  3884. -chardev socket,id=chardev0,path=/path/to/socket \
  3885. -object cryptodev-vhost-user,id=cryptodev0,chardev=chardev0 \
  3886. -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \
  3887. [...]
  3888. ``-object secret,id=id,data=string,format=raw|base64[,keyid=secretid,iv=string]``
  3889. \
  3890. ``-object secret,id=id,file=filename,format=raw|base64[,keyid=secretid,iv=string]``
  3891. Defines a secret to store a password, encryption key, or some
  3892. other sensitive data. The sensitive data can either be passed
  3893. directly via the data parameter, or indirectly via the file
  3894. parameter. Using the data parameter is insecure unless the
  3895. sensitive data is encrypted.
  3896. The sensitive data can be provided in raw format (the default),
  3897. or base64. When encoded as JSON, the raw format only supports
  3898. valid UTF-8 characters, so base64 is recommended for sending
  3899. binary data. QEMU will convert from which ever format is
  3900. provided to the format it needs internally. eg, an RBD password
  3901. can be provided in raw format, even though it will be base64
  3902. encoded when passed onto the RBD sever.
  3903. For added protection, it is possible to encrypt the data
  3904. associated with a secret using the AES-256-CBC cipher. Use of
  3905. encryption is indicated by providing the keyid and iv
  3906. parameters. The keyid parameter provides the ID of a previously
  3907. defined secret that contains the AES-256 decryption key. This
  3908. key should be 32-bytes long and be base64 encoded. The iv
  3909. parameter provides the random initialization vector used for
  3910. encryption of this particular secret and should be a base64
  3911. encrypted string of the 16-byte IV.
  3912. The simplest (insecure) usage is to provide the secret inline
  3913. .. parsed-literal::
  3914. # |qemu_system| -object secret,id=sec0,data=letmein,format=raw
  3915. The simplest secure usage is to provide the secret via a file
  3916. # printf "letmein" > mypasswd.txt # QEMU\_SYSTEM\_MACRO -object
  3917. secret,id=sec0,file=mypasswd.txt,format=raw
  3918. For greater security, AES-256-CBC should be used. To illustrate
  3919. usage, consider the openssl command line tool which can encrypt
  3920. the data. Note that when encrypting, the plaintext must be
  3921. padded to the cipher block size (32 bytes) using the standard
  3922. PKCS#5/6 compatible padding algorithm.
  3923. First a master key needs to be created in base64 encoding:
  3924. ::
  3925. # openssl rand -base64 32 > key.b64
  3926. # KEY=$(base64 -d key.b64 | hexdump -v -e '/1 "%02X"')
  3927. Each secret to be encrypted needs to have a random
  3928. initialization vector generated. These do not need to be kept
  3929. secret
  3930. ::
  3931. # openssl rand -base64 16 > iv.b64
  3932. # IV=$(base64 -d iv.b64 | hexdump -v -e '/1 "%02X"')
  3933. The secret to be defined can now be encrypted, in this case
  3934. we're telling openssl to base64 encode the result, but it could
  3935. be left as raw bytes if desired.
  3936. ::
  3937. # SECRET=$(printf "letmein" |
  3938. openssl enc -aes-256-cbc -a -K $KEY -iv $IV)
  3939. When launching QEMU, create a master secret pointing to
  3940. ``key.b64`` and specify that to be used to decrypt the user
  3941. password. Pass the contents of ``iv.b64`` to the second secret
  3942. .. parsed-literal::
  3943. # |qemu_system| \
  3944. -object secret,id=secmaster0,format=base64,file=key.b64 \
  3945. -object secret,id=sec0,keyid=secmaster0,format=base64,\
  3946. data=$SECRET,iv=$(<iv.b64)
  3947. ``-object sev-guest,id=id,cbitpos=cbitpos,reduced-phys-bits=val,[sev-device=string,policy=policy,handle=handle,dh-cert-file=file,session-file=file]``
  3948. Create a Secure Encrypted Virtualization (SEV) guest object,
  3949. which can be used to provide the guest memory encryption support
  3950. on AMD processors.
  3951. When memory encryption is enabled, one of the physical address
  3952. bit (aka the C-bit) is utilized to mark if a memory page is
  3953. protected. The ``cbitpos`` is used to provide the C-bit
  3954. position. The C-bit position is Host family dependent hence user
  3955. must provide this value. On EPYC, the value should be 47.
  3956. When memory encryption is enabled, we loose certain bits in
  3957. physical address space. The ``reduced-phys-bits`` is used to
  3958. provide the number of bits we loose in physical address space.
  3959. Similar to C-bit, the value is Host family dependent. On EPYC,
  3960. the value should be 5.
  3961. The ``sev-device`` provides the device file to use for
  3962. communicating with the SEV firmware running inside AMD Secure
  3963. Processor. The default device is '/dev/sev'. If hardware
  3964. supports memory encryption then /dev/sev devices are created by
  3965. CCP driver.
  3966. The ``policy`` provides the guest policy to be enforced by the
  3967. SEV firmware and restrict what configuration and operational
  3968. commands can be performed on this guest by the hypervisor. The
  3969. policy should be provided by the guest owner and is bound to the
  3970. guest and cannot be changed throughout the lifetime of the
  3971. guest. The default is 0.
  3972. If guest ``policy`` allows sharing the key with another SEV
  3973. guest then ``handle`` can be use to provide handle of the guest
  3974. from which to share the key.
  3975. The ``dh-cert-file`` and ``session-file`` provides the guest
  3976. owner's Public Diffie-Hillman key defined in SEV spec. The PDH
  3977. and session parameters are used for establishing a cryptographic
  3978. session with the guest owner to negotiate keys used for
  3979. attestation. The file must be encoded in base64.
  3980. e.g to launch a SEV guest
  3981. .. parsed-literal::
  3982. # |qemu_system_x86| \
  3983. ......
  3984. -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=5 \
  3985. -machine ...,memory-encryption=sev0
  3986. .....
  3987. ``-object authz-simple,id=id,identity=string``
  3988. Create an authorization object that will control access to
  3989. network services.
  3990. The ``identity`` parameter is identifies the user and its format
  3991. depends on the network service that authorization object is
  3992. associated with. For authorizing based on TLS x509 certificates,
  3993. the identity must be the x509 distinguished name. Note that care
  3994. must be taken to escape any commas in the distinguished name.
  3995. An example authorization object to validate a x509 distinguished
  3996. name would look like:
  3997. .. parsed-literal::
  3998. # |qemu_system| \
  3999. ...
  4000. -object 'authz-simple,id=auth0,identity=CN=laptop.example.com,,O=Example Org,,L=London,,ST=London,,C=GB' \
  4001. ...
  4002. Note the use of quotes due to the x509 distinguished name
  4003. containing whitespace, and escaping of ','.
  4004. ``-object authz-listfile,id=id,filename=path,refresh=yes|no``
  4005. Create an authorization object that will control access to
  4006. network services.
  4007. The ``filename`` parameter is the fully qualified path to a file
  4008. containing the access control list rules in JSON format.
  4009. An example set of rules that match against SASL usernames might
  4010. look like:
  4011. ::
  4012. {
  4013. "rules": [
  4014. { "match": "fred", "policy": "allow", "format": "exact" },
  4015. { "match": "bob", "policy": "allow", "format": "exact" },
  4016. { "match": "danb", "policy": "deny", "format": "glob" },
  4017. { "match": "dan*", "policy": "allow", "format": "exact" },
  4018. ],
  4019. "policy": "deny"
  4020. }
  4021. When checking access the object will iterate over all the rules
  4022. and the first rule to match will have its ``policy`` value
  4023. returned as the result. If no rules match, then the default
  4024. ``policy`` value is returned.
  4025. The rules can either be an exact string match, or they can use
  4026. the simple UNIX glob pattern matching to allow wildcards to be
  4027. used.
  4028. If ``refresh`` is set to true the file will be monitored and
  4029. automatically reloaded whenever its content changes.
  4030. As with the ``authz-simple`` object, the format of the identity
  4031. strings being matched depends on the network service, but is
  4032. usually a TLS x509 distinguished name, or a SASL username.
  4033. An example authorization object to validate a SASL username
  4034. would look like:
  4035. .. parsed-literal::
  4036. # |qemu_system| \
  4037. ...
  4038. -object authz-simple,id=auth0,filename=/etc/qemu/vnc-sasl.acl,refresh=yes
  4039. ...
  4040. ``-object authz-pam,id=id,service=string``
  4041. Create an authorization object that will control access to
  4042. network services.
  4043. The ``service`` parameter provides the name of a PAM service to
  4044. use for authorization. It requires that a file
  4045. ``/etc/pam.d/service`` exist to provide the configuration for
  4046. the ``account`` subsystem.
  4047. An example authorization object to validate a TLS x509
  4048. distinguished name would look like:
  4049. .. parsed-literal::
  4050. # |qemu_system| \
  4051. ...
  4052. -object authz-pam,id=auth0,service=qemu-vnc
  4053. ...
  4054. There would then be a corresponding config file for PAM at
  4055. ``/etc/pam.d/qemu-vnc`` that contains:
  4056. ::
  4057. account requisite pam_listfile.so item=user sense=allow \
  4058. file=/etc/qemu/vnc.allow
  4059. Finally the ``/etc/qemu/vnc.allow`` file would contain the list
  4060. of x509 distingished names that are permitted access
  4061. ::
  4062. CN=laptop.example.com,O=Example Home,L=London,ST=London,C=GB
  4063. ``-object iothread,id=id,poll-max-ns=poll-max-ns,poll-grow=poll-grow,poll-shrink=poll-shrink``
  4064. Creates a dedicated event loop thread that devices can be
  4065. assigned to. This is known as an IOThread. By default device
  4066. emulation happens in vCPU threads or the main event loop thread.
  4067. This can become a scalability bottleneck. IOThreads allow device
  4068. emulation and I/O to run on other host CPUs.
  4069. The ``id`` parameter is a unique ID that will be used to
  4070. reference this IOThread from ``-device ...,iothread=id``.
  4071. Multiple devices can be assigned to an IOThread. Note that not
  4072. all devices support an ``iothread`` parameter.
  4073. The ``query-iothreads`` QMP command lists IOThreads and reports
  4074. their thread IDs so that the user can configure host CPU
  4075. pinning/affinity.
  4076. IOThreads use an adaptive polling algorithm to reduce event loop
  4077. latency. Instead of entering a blocking system call to monitor
  4078. file descriptors and then pay the cost of being woken up when an
  4079. event occurs, the polling algorithm spins waiting for events for
  4080. a short time. The algorithm's default parameters are suitable
  4081. for many cases but can be adjusted based on knowledge of the
  4082. workload and/or host device latency.
  4083. The ``poll-max-ns`` parameter is the maximum number of
  4084. nanoseconds to busy wait for events. Polling can be disabled by
  4085. setting this value to 0.
  4086. The ``poll-grow`` parameter is the multiplier used to increase
  4087. the polling time when the algorithm detects it is missing events
  4088. due to not polling long enough.
  4089. The ``poll-shrink`` parameter is the divisor used to decrease
  4090. the polling time when the algorithm detects it is spending too
  4091. long polling without encountering events.
  4092. The polling parameters can be modified at run-time using the
  4093. ``qom-set`` command (where ``iothread1`` is the IOThread's
  4094. ``id``):
  4095. ::
  4096. (qemu) qom-set /objects/iothread1 poll-max-ns 100000
  4097. ERST
  4098. HXCOMM This is the last statement. Insert new options before this line!