qemu-options.hx 230 KB

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