&sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget5/translations/zh_CN/virt/uml/user_mode_linux_howto_v2modnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/zh_TW/virt/uml/user_mode_linux_howto_v2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/it_IT/virt/uml/user_mode_linux_howto_v2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/ja_JP/virt/uml/user_mode_linux_howto_v2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/ko_KR/virt/uml/user_mode_linux_howto_v2modnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget5/translations/sp_SP/virt/uml/user_mode_linux_howto_v2modnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhO/var/lib/git/docbuild/linux/Documentation/virt/uml/user_mode_linux_howto_v2.rsthKubhsection)}(hhh](htitle)}(h UML HowToh]h UML HowTo}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubhtopic)}(hhh]h bullet_list)}(hhh](h list_item)}(hhh](h paragraph)}(hhh]h reference)}(hhh]h Introduction}(hhhhhNhNubah}(h]id1ah ]h"]h$]h&]refid introductionuh1hhhubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh](h)}(hhh]h)}(hhh]h)}(hhh]h>How is UML Different from a VM using Virtualization package X?}(hhhhhNhNubah}(h]id2ah ]h"]h$]h&]refid=how-is-uml-different-from-a-vm-using-virtualization-package-xuh1hhhubah}(h]h ]h"]h$]h&]uh1hhhubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh]h)}(hhh]h)}(hhh]h!Why Would I Want User Mode Linux?}(hj hhhNhNubah}(h]id3ah ]h"]h$]h&]refid why-would-i-want-user-mode-linuxuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh]h)}(hhh]h)}(hhh]hWhy not to run UML}(hjBhhhNhNubah}(h]id4ah ]h"]h$]h&]refidwhy-not-to-run-umluh1hhj?ubah}(h]h ]h"]h$]h&]uh1hhj<ubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh](h)}(hhh]h)}(hhh]hBuilding a UML instance}(hjphhhNhNubah}(h]id5ah ]h"]h$]h&]refidbuilding-a-uml-instanceuh1hhjmubah}(h]h ]h"]h$]h&]uh1hhjjubh)}(hhh](h)}(hhh]h)}(hhh]h)}(hhh]hCreating an image}(hjhhhNhNubah}(h]id6ah ]h"]h$]h&]refidcreating-an-imageuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hEdit key system files}(hjhhhNhNubah}(h]id7ah ]h"]h$]h&]refidedit-key-system-filesuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhjjubeh}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh](h)}(hhh]h)}(hhh]hSetting Up UML Networking}(hjhhhNhNubah}(h]id8ah ]h"]h$]h&]refidsetting-up-uml-networkinguh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh](h)}(hhh]h)}(hhh]h)}(hhh]h Network configuration privileges}(hjhhhNhNubah}(h]id9ah ]h"]h$]h&]refid network-configuration-privilegesuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh](h)}(hhh]h)}(hhh]hConfiguring vector transports}(hj hhhNhNubah}(h]id10ah ]h"]h$]h&]refidconfiguring-vector-transportsuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh](h)}(hhh]h)}(hhh]h)}(hhh]hCommon options}(hj?hhhNhNubah}(h]id11ah ]h"]h$]h&]refidcommon-optionsuh1hhj<ubah}(h]h ]h"]h$]h&]uh1hhj9ubah}(h]h ]h"]h$]h&]uh1hhj6ubh)}(hhh]h)}(hhh]h)}(hhh]hShared Options}(hjahhhNhNubah}(h]id12ah ]h"]h$]h&]refidshared-optionsuh1hhj^ubah}(h]h ]h"]h$]h&]uh1hhj[ubah}(h]h ]h"]h$]h&]uh1hhj6ubh)}(hhh]h)}(hhh]h)}(hhh]h tap transport}(hjhhhNhNubah}(h]id13ah ]h"]h$]h&]refid tap-transportuh1hhjubah}(h]h ]h"]h$]h&]uh1hhj}ubah}(h]h ]h"]h$]h&]uh1hhj6ubh)}(hhh]h)}(hhh]h)}(hhh]hhybrid transport}(hjhhhNhNubah}(h]id14ah ]h"]h$]h&]refidhybrid-transportuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhj6ubh)}(hhh]h)}(hhh]h)}(hhh]hraw socket transport}(hjhhhNhNubah}(h]id15ah ]h"]h$]h&]refidraw-socket-transportuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhj6ubh)}(hhh]h)}(hhh]h)}(hhh]hGRE socket transport}(hjhhhNhNubah}(h]id16ah ]h"]h$]h&]refidgre-socket-transportuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhj6ubh)}(hhh]h)}(hhh]h)}(hhh]hl2tpv3 socket transport}(hj hhhNhNubah}(h]id17ah ]h"]h$]h&]refidl2tpv3-socket-transportuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhj6ubh)}(hhh]h)}(hhh]h)}(hhh]hBESS socket transport}(hj-hhhNhNubah}(h]id18ah ]h"]h$]h&]refidbess-socket-transportuh1hhj*ubah}(h]h ]h"]h$]h&]uh1hhj'ubah}(h]h ]h"]h$]h&]uh1hhj6ubh)}(hhh]h)}(hhh]h)}(hhh]hVDE vector transport}(hjOhhhNhNubah}(h]id19ah ]h"]h$]h&]refidvde-vector-transportuh1hhjLubah}(h]h ]h"]h$]h&]uh1hhjIubah}(h]h ]h"]h$]h&]uh1hhj6ubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hConfiguring Legacy transports}(hj}hhhNhNubah}(h]id20ah ]h"]h$]h&]refidconfiguring-legacy-transportsuh1hhjzubah}(h]h ]h"]h$]h&]uh1hhjwubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh](h)}(hhh]h)}(hhh]h Running UML}(hjhhhNhNubah}(h]id21ah ]h"]h$]h&]refid running-umluh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh](h)}(hhh](h)}(hhh]h)}(hhh]h Arguments}(hjhhhNhNubah}(h]id22ah ]h"]h$]h&]refid argumentsuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh](h)}(hhh]h)}(hhh]h)}(hhh]hMandatory Arguments:}(hjhhhNhNubah}(h]id23ah ]h"]h$]h&]refidmandatory-argumentsuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hImportant Optional Arguments}(hj hhhNhNubah}(h]id24ah ]h"]h$]h&]refidimportant-optional-argumentsuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]h Starting UML}(hj9hhhNhNubah}(h]id25ah ]h"]h$]h&]refid starting-umluh1hhj6ubah}(h]h ]h"]h$]h&]uh1hhj3ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]h Logging in}(hj[hhhNhNubah}(h]id26ah ]h"]h$]h&]refid logging-inuh1hhjXubah}(h]h ]h"]h$]h&]uh1hhjUubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh](h)}(hhh]h)}(hhh]hThe UML Management Console}(hj}hhhNhNubah}(h]id27ah ]h"]h$]h&]refidthe-uml-management-consoleuh1hhjzubah}(h]h ]h"]h$]h&]uh1hhjwubh)}(hhh](h)}(hhh]h)}(hhh]h)}(hhh]hversion}(hjhhhNhNubah}(h]id28ah ]h"]h$]h&]refidversionuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hhelp}(hjhhhNhNubah}(h]id29ah ]h"]h$]h&]refidhelpuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hhalt and reboot}(hjhhhNhNubah}(h]id30ah ]h"]h$]h&]refidhalt-and-rebootuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hconfig}(hjhhhNhNubah}(h]id31ah ]h"]h$]h&]refidconfiguh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hremove}(hj$hhhNhNubah}(h]id32ah ]h"]h$]h&]refidremoveuh1hhj!ubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hsysrq}(hjFhhhNhNubah}(h]id33ah ]h"]h$]h&]refidsysrquh1hhjCubah}(h]h ]h"]h$]h&]uh1hhj@ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hcad}(hjhhhhNhNubah}(h]id34ah ]h"]h$]h&]refidcaduh1hhjeubah}(h]h ]h"]h$]h&]uh1hhjbubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hstop}(hjhhhNhNubah}(h]id35ah ]h"]h$]h&]refidstopuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hgo}(hjhhhNhNubah}(h]id36ah ]h"]h$]h&]refidgouh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hproc}(hjhhhNhNubah}(h]id37ah ]h"]h$]h&]refidprocuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hstack}(hjhhhNhNubah}(h]id38ah ]h"]h$]h&]refidstackuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhjwubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh](h)}(hhh]h)}(hhh]hAdvanced UML Topics}(hj*hhhNhNubah}(h]id39ah ]h"]h$]h&]refidadvanced-uml-topicsuh1hhj'ubah}(h]h ]h"]h$]h&]uh1hhj$ubh)}(hhh](h)}(hhh](h)}(hhh]h)}(hhh]h,Sharing Filesystems between Virtual Machines}(hjIhhhNhNubah}(h]id40ah ]h"]h$]h&]refid,sharing-filesystems-between-virtual-machinesuh1hhjFubah}(h]h ]h"]h$]h&]uh1hhjCubh)}(hhh](h)}(hhh]h)}(hhh]h)}(hhh]hUsing layered block devices}(hjhhhhNhNubah}(h]id41ah ]h"]h$]h&]refidusing-layered-block-devicesuh1hhjeubah}(h]h ]h"]h$]h&]uh1hhjbubah}(h]h ]h"]h$]h&]uh1hhj_ubh)}(hhh]h)}(hhh]h)}(hhh]h Disk Usage}(hjhhhNhNubah}(h]id42ah ]h"]h$]h&]refid disk-usageuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhj_ubh)}(hhh]h)}(hhh]h)}(hhh]h COW validity.}(hjhhhNhNubah}(h]id43ah ]h"]h$]h&]refid cow-validityuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhj_ubh)}(hhh]h)}(hhh]h)}(hhh]hACows can moo - uml_moo : Merging a COW file with its backing file}(hjhhhNhNubah}(h]id44ah ]h"]h$]h&]refid=cows-can-moo-uml-moo-merging-a-cow-file-with-its-backing-fileuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhj_ubeh}(h]h ]h"]h$]h&]uh1hhjCubeh}(h]h ]h"]h$]h&]uh1hhj@ubh)}(hhh](h)}(hhh]h)}(hhh]hHost file access}(hjhhhNhNubah}(h]id45ah ]h"]h$]h&]refidhost-file-accessuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh](h)}(hhh]h)}(hhh]h)}(hhh]h Using hostfs}(hjhhhNhNubah}(h]id46ah ]h"]h$]h&]refid using-hostfsuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hhostfs as the root filesystem}(hj=hhhNhNubah}(h]id47ah ]h"]h$]h&]refidhostfs-as-the-root-filesystemuh1hhj:ubah}(h]h ]h"]h$]h&]uh1hhj7ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hHostfs Caveats}(hj_hhhNhNubah}(h]id48ah ]h"]h$]h&]refidhostfs-caveatsuh1hhj\ubah}(h]h ]h"]h$]h&]uh1hhjYubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhj@ubh)}(hhh]h)}(hhh]h)}(hhh]h Tuning UML}(hjhhhNhNubah}(h]id49ah ]h"]h$]h&]refid tuning-umluh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhj@ubeh}(h]h ]h"]h$]h&]uh1hhj$ubeh}(h]h ]h"]h$]h&]uh1hhhubh)}(hhh](h)}(hhh]h)}(hhh]h+Contributing to UML and Developing with UML}(hjhhhNhNubah}(h]id50ah ]h"]h$]h&]refid+contributing-to-uml-and-developing-with-umluh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh](h)}(hhh]h)}(hhh]h)}(hhh]h Tracing UML}(hjhhhNhNubah}(h]id51ah ]h"]h$]h&]refid tracing-umluh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hKernel debugging}(hjhhhNhNubah}(h]id52ah ]h"]h$]h&]refidkernel-debugginguh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh]h)}(hhh]h)}(hhh]hDeveloping Device Drivers}(hjhhhNhNubah}(h]id53ah ]h"]h$]h&]refiddeveloping-device-driversuh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hhh](h)}(hhh]h)}(hhh]hUsing UML as a Test Platform}(hj@hhhNhNubah}(h]id54ah ]h"]h$]h&]refidusing-uml-as-a-test-platformuh1hhj=ubah}(h]h ]h"]h$]h&]uh1hhj:ubh)}(hhh]h)}(hhh]h)}(hhh]h)}(hhh]hSecurity Considerations}(hj_hhhNhNubah}(h]id55ah ]h"]h$]h&]refidsecurity-considerationsuh1hhj\ubah}(h]h ]h"]h$]h&]uh1hhjYubah}(h]h ]h"]h$]h&]uh1hhjVubah}(h]h ]h"]h$]h&]uh1hhj:ubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhhhNhNubah}(h]contentsah ](contentslocaleh"]contentsah$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(h Introductionh]h Introduction}(hjhhhNhNubah}(h]h ]h"]h$]h&]refidhuh1hhjhhhhhK ubh)}(hWelcome to User Mode Linuxh]hWelcome to User Mode Linux}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hjhhubh)}(hUser Mode Linux is the first Open Source virtualization platform (first release date 1991) and second virtualization platform for an x86 PC.h]hUser Mode Linux is the first Open Source virtualization platform (first release date 1991) and second virtualization platform for an x86 PC.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hhh](h)}(h>How is UML Different from a VM using Virtualization package X?h]h>How is UML Different from a VM using Virtualization package X?}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjhhhhhKubh)}(hXWe have come to assume that virtualization also means some level of hardware emulation. In fact, it does not. As long as a virtualization package provides the OS with devices which the OS can recognize and has a driver for, the devices do not need to emulate real hardware. Most OSes today have built-in support for a number of "fake" devices used only under virtualization. User Mode Linux takes this concept to the ultimate extreme - there is not a single real device in sight. It is 100% artificial or if we use the correct term 100% paravirtual. All UML devices are abstract concepts which map onto something provided by the host - files, sockets, pipes, etc.h]hXWe have come to assume that virtualization also means some level of hardware emulation. In fact, it does not. As long as a virtualization package provides the OS with devices which the OS can recognize and has a driver for, the devices do not need to emulate real hardware. Most OSes today have built-in support for a number of “fake” devices used only under virtualization. User Mode Linux takes this concept to the ultimate extreme - there is not a single real device in sight. It is 100% artificial or if we use the correct term 100% paravirtual. All UML devices are abstract concepts which map onto something provided by the host - files, sockets, pipes, etc.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hX\The other major difference between UML and various virtualization packages is that there is a distinct difference between the way the UML kernel and the UML programs operate. The UML kernel is just a process running on Linux - same as any other program. It can be run by an unprivileged user and it does not require anything in terms of special CPU features. The UML userspace, however, is a bit different. The Linux kernel on the host machine assists UML in intercepting everything the program running on a UML instance is trying to do and making the UML kernel handle all of its requests. This is different from other virtualization packages which do not make any difference between the guest kernel and guest programs. This difference results in a number of advantages and disadvantages of UML over let's say QEMU which we will cover later in this document.h]hX^The other major difference between UML and various virtualization packages is that there is a distinct difference between the way the UML kernel and the UML programs operate. The UML kernel is just a process running on Linux - same as any other program. It can be run by an unprivileged user and it does not require anything in terms of special CPU features. The UML userspace, however, is a bit different. The Linux kernel on the host machine assists UML in intercepting everything the program running on a UML instance is trying to do and making the UML kernel handle all of its requests. This is different from other virtualization packages which do not make any difference between the guest kernel and guest programs. This difference results in a number of advantages and disadvantages of UML over let’s say QEMU which we will cover later in this document.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hjhhubeh}(h]j ah ]h"]>how is uml different from a vm using virtualization package x?ah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h!Why Would I Want User Mode Linux?h]h!Why Would I Want User Mode Linux?}(hj hhhNhNubah}(h]h ]h"]h$]h&]jj)uh1hhj hhhhhK2ubh)}(hhh](h)}(hIf User Mode Linux kernel crashes, your host kernel is still fine. It is not accelerated in any way (vhost, kvm, etc) and it is not trying to access any devices directly. It is, in fact, a process like any other. h]h)}(hIf User Mode Linux kernel crashes, your host kernel is still fine. It is not accelerated in any way (vhost, kvm, etc) and it is not trying to access any devices directly. It is, in fact, a process like any other.h]hIf User Mode Linux kernel crashes, your host kernel is still fine. It is not accelerated in any way (vhost, kvm, etc) and it is not trying to access any devices directly. It is, in fact, a process like any other.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK5hj ubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(huYou can run a usermode kernel as a non-root user (you may need to arrange appropriate permissions for some devices). h]h)}(htYou can run a usermode kernel as a non-root user (you may need to arrange appropriate permissions for some devices).h]htYou can run a usermode kernel as a non-root user (you may need to arrange appropriate permissions for some devices).}(hj5 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK9hj1 ubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(hdYou can run a very small VM with a minimal footprint for a specific task (for example 32M or less). h]h)}(hcYou can run a very small VM with a minimal footprint for a specific task (for example 32M or less).h]hcYou can run a very small VM with a minimal footprint for a specific task (for example 32M or less).}(hjM hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK 8Gbith]h> 8Gbit}(hj> hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj; ubah}(h]h ]h"]h$]h&]uh1j hj ubeh}(h]h ]h"]h$]h&]uh1j hj ubj )}(hhh](j )}(hhh]h)}(hhybridh]hhybrid}(hj^ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj[ ubah}(h]h ]h"]h$]h&]uh1j hjX ubj )}(hhh]h)}(hvectorh]hvector}(hju hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjr ubah}(h]h ]h"]h$]h&]uh1j hjX ubj )}(hhh]h)}(hchecksum, tso, multipacket rxh]hchecksum, tso, multipacket rx}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j hjX ubj )}(hhh]h)}(h> 6GBith]h> 6GBit}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j hjX ubeh}(h]h ]h"]h$]h&]uh1j hj ubj )}(hhh](j )}(hhh]h)}(hrawh]hraw}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j hj ubj )}(hhh]h)}(hvectorh]hvector}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j hj ubj )}(hhh]h)}(h"checksum, tso, multipacket rx, tx"h]h$checksum, tso, multipacket rx, tx”}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1j hj ubj )}(hhh]h)}(h> 6GBith]h> 6GBit}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hj ubeh}(h]h ]h"]h$]h&]uh1j hj ubj )}(hhh](j )}(hhh]h)}(hEoGREh]hEoGRE}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj%ubah}(h]h ]h"]h$]h&]uh1j hj"ubj )}(hhh]h)}(hvectorh]hvector}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj<ubah}(h]h ]h"]h$]h&]uh1j hj"ubj )}(hhh]h)}(hmultipacket rx, txh]hmultipacket rx, tx}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjSubah}(h]h ]h"]h$]h&]uh1j hj"ubj )}(hhh]h)}(h> 3Gbith]h> 3Gbit}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjjubah}(h]h ]h"]h$]h&]uh1j hj"ubeh}(h]h ]h"]h$]h&]uh1j hj ubj )}(hhh](j )}(hhh]h)}(hEol2tpv3h]hEol2tpv3}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hvectorh]hvector}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hmultipacket rx, txh]hmultipacket rx, tx}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(h> 3Gbith]h> 3Gbit}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hj ubj )}(hhh](j )}(hhh]h)}(hbessh]hbess}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hvectorh]hvector}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hmultipacket rx, txh]hmultipacket rx, tx}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(h> 3Gbith]h> 3Gbit}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj4ubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hj ubj )}(hhh](j )}(hhh]h)}(hfdh]hfd}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjTubah}(h]h ]h"]h$]h&]uh1j hjQubj )}(hhh]h)}(hvectorh]hvector}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjkubah}(h]h ]h"]h$]h&]uh1j hjQubj )}(hhh]h)}(hdependent on fd typeh]hdependent on fd type}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjQubj )}(hhh]h)}(hvariesh]hvaries}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjQubeh}(h]h ]h"]h$]h&]uh1j hj ubj )}(hhh](j )}(hhh]h)}(hvdeh]hvde}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hvectorh]hvector}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(h!dep. on VDE VPN: Virt.Net Locatorh]h!dep. on VDE VPN: Virt.Net Locator}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hvariesh]hvaries}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hj ubj )}(hhh](j )}(hhh]h)}(htuntaph]htuntap}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hlegacyh]hlegacy}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj5ubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hnoneh]hnone}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjLubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(h ~ 500Mbith]h ~ 500Mbit}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjcubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hj ubj )}(hhh](j )}(hhh]h)}(hdaemonh]hdaemon}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hlegacyh]hlegacy}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hnoneh]hnone}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(h ~ 450Mbith]h ~ 450Mbit}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hj ubj )}(hhh](j )}(hhh]h)}(hsocketh]hsocket}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hlegacyh]hlegacy}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hnoneh]hnone}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(h ~ 450Mbith]h ~ 450Mbit}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj-ubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hj ubj )}(hhh](j )}(hhh]h)}(hethertaph]hethertap}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjMubah}(h]h ]h"]h$]h&]uh1j hjJubj )}(hhh]h)}(hlegacyh]hlegacy}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjdubah}(h]h ]h"]h$]h&]uh1j hjJubj )}(hhh]h)}(hobsoleteh]hobsolete}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj{ubah}(h]h ]h"]h$]h&]uh1j hjJubj )}(hhh]h)}(h ~ 500Mbith]h ~ 500Mbit}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjJubeh}(h]h ]h"]h$]h&]uh1j hj ubj )}(hhh](j )}(hhh]h)}(hvdeh]hvde}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hlegacyh]hlegacy}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(hobsoleteh]hobsolete}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubj )}(hhh]h)}(h ~ 500Mbith]h ~ 500Mbit}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1j hj ubeh}(h]h ]h"]h$]h&]uh1j hjM ubeh}(h]h ]h"]h$]h&]colsKuh1jK hjH ubah}(h]h ]h"]h$]h&]uh1jF hj' hhhhhNubh)}(hhh](h)}(hgAll transports which have tso and checksum offloads can deliver speeds approaching 10G on TCP streams. h]h)}(hfAll transports which have tso and checksum offloads can deliver speeds approaching 10G on TCP streams.h]hfAll transports which have tso and checksum offloads can deliver speeds approaching 10G on TCP streams.}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj*ubah}(h]h ]h"]h$]h&]uh1hhj'hhhhhNubh)}(haAll transports which have multi-packet rx and/or tx can deliver pps rates of up to 1Mps or more. h]h)}(h`All transports which have multi-packet rx and/or tx can deliver pps rates of up to 1Mps or more.h]h`All transports which have multi-packet rx and/or tx can deliver pps rates of up to 1Mps or more.}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjBubah}(h]h ]h"]h$]h&]uh1hhj'hhhhhNubh)}(hIAll legacy transports are generally limited to ~600-700MBit and 0.05Mps. h]h)}(hHAll legacy transports are generally limited to ~600-700MBit and 0.05Mps.h]hHAll legacy transports are generally limited to ~600-700MBit and 0.05Mps.}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjZubah}(h]h ]h"]h$]h&]uh1hhj'hhhhhNubh)}(h}GRE and L2TPv3 allow connections to all of: local machine, remote machines, remote network devices and remote UML instances. h]h)}(h|GRE and L2TPv3 allow connections to all of: local machine, remote machines, remote network devices and remote UML instances.h]h|GRE and L2TPv3 allow connections to all of: local machine, remote machines, remote network devices and remote UML instances.}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjrubah}(h]h ]h"]h$]h&]uh1hhj'hhhhhNubh)}(h6Socket allows connections only between UML instances. h]h)}(h5Socket allows connections only between UML instances.h]h5Socket allows connections only between UML instances.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj'hhhhhNubh)}(hcDaemon and bess require running a local switch. This switch may be connected to the host as well. h]h)}(haDaemon and bess require running a local switch. This switch may be connected to the host as well.h]haDaemon and bess require running a local switch. This switch may be connected to the host as well.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj'hhhhhNubeh}(h]h ]h"]h$]h&]j j uh1hhhhKhj' hhubh)}(hhh](h)}(h Network configuration privilegesh]h Network configuration privileges}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjhhhhhKubh)}(hThe majority of the supported networking modes need ``root`` privileges. For example, in the legacy tuntap networking mode, users were required to be part of the group associated with the tunnel device.h](h4The majority of the supported networking modes need }(hjhhhNhNubj )}(h``root``h]hroot}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh privileges. For example, in the legacy tuntap networking mode, users were required to be part of the group associated with the tunnel device.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hFor newer network drivers like the vector transports, ``root`` privilege is required to fire an ioctl to setup the tun interface and/or use raw sockets where needed.h](h6For newer network drivers like the vector transports, }(hjhhhNhNubj )}(h``root``h]hroot}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubhg privilege is required to fire an ioctl to setup the tun interface and/or use raw sockets where needed.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hX)This can be achieved by granting the user a particular capability instead of running UML as root. In case of vector transport, a user can add the capability ``CAP_NET_ADMIN`` or ``CAP_NET_RAW`` to the uml binary. Thenceforth, UML can be run with normal user privilges, along with full networking.h](hThis can be achieved by granting the user a particular capability instead of running UML as root. In case of vector transport, a user can add the capability }(hjhhhNhNubj )}(h``CAP_NET_ADMIN``h]h CAP_NET_ADMIN}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh or }(hjhhhNhNubj )}(h``CAP_NET_RAW``h]h CAP_NET_RAW}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubhg to the uml binary. Thenceforth, UML can be run with normal user privilges, along with full networking.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h For example::h]h For example:}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjhhubj )}(h0# sudo setcap cap_net_raw,cap_net_admin+ep linuxh]h0# sudo setcap cap_net_raw,cap_net_admin+ep linux}hjQsbah}(h]h ]h"]h$]h&]hhuh1j hhhM hjhhubeh}(h]j ah ]h"] network configuration privilegesah$]h&]uh1hhj' hhhhhKubh)}(hhh](h)}(hConfiguring vector transportsh]hConfiguring vector transports}(hjihhhNhNubah}(h]h ]h"]h$]h&]jj)uh1hhjfhhhhhMubh)}(h/All vector transports support a similar syntax:h]h/All vector transports support a similar syntax:}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjfhhubh)}(h]If X is the interface number as in vec0, vec1, vec2, etc, the general syntax for options is::h]h\If X is the interface number as in vec0, vec1, vec2, etc, the general syntax for options is:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjfhhubj )}(hJvecX:transport="Transport Name",option=value,option=value,...,option=valueh]hJvecX:transport="Transport Name",option=value,option=value,...,option=value}hjsbah}(h]h ]h"]h$]h&]hhuh1j hhhMhjfhhubh)}(hhh](h)}(hCommon optionsh]hCommon options}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjHuh1hhjhhhhhMubh)}(h,These options are common for all transports:h]h,These options are common for all transports:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hhh](h)}(hX-``depth=int`` - sets the queue depth for vector IO. This is the amount of packets UML will attempt to read or write in a single system call. The default number is 64 and is generally sufficient for most applications that need throughput in the 2-4 Gbit range. Higher speeds may require larger values. h]h)}(hX,``depth=int`` - sets the queue depth for vector IO. This is the amount of packets UML will attempt to read or write in a single system call. The default number is 64 and is generally sufficient for most applications that need throughput in the 2-4 Gbit range. Higher speeds may require larger values.h](j )}(h ``depth=int``h]h depth=int}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubhX - sets the queue depth for vector IO. This is the amount of packets UML will attempt to read or write in a single system call. The default number is 64 and is generally sufficient for most applications that need throughput in the 2-4 Gbit range. Higher speeds may require larger values.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h?``mac=XX:XX:XX:XX:XX`` - sets the interface MAC address value. h]h)}(h>``mac=XX:XX:XX:XX:XX`` - sets the interface MAC address value.h](j )}(h``mac=XX:XX:XX:XX:XX``h]hmac=XX:XX:XX:XX:XX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh( - sets the interface MAC address value.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM$hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hXX``gro=[0,1]`` - sets GRO off or on. Enables receive/transmit offloads. The effect of this option depends on the host side support in the transport which is being configured. In most cases it will enable TCP segmentation and RX/TX checksumming offloads. The setting must be identical on the host side and the UML side. The UML kernel will produce warnings if it is not. For example, GRO is enabled by default on local machine interfaces (e.g. veth pairs, bridge, etc), so it should be enabled in UML in the corresponding UML transports (raw, tap, hybrid) in order for networking to operate correctly. h]h)}(hXW``gro=[0,1]`` - sets GRO off or on. Enables receive/transmit offloads. The effect of this option depends on the host side support in the transport which is being configured. In most cases it will enable TCP segmentation and RX/TX checksumming offloads. The setting must be identical on the host side and the UML side. The UML kernel will produce warnings if it is not. For example, GRO is enabled by default on local machine interfaces (e.g. veth pairs, bridge, etc), so it should be enabled in UML in the corresponding UML transports (raw, tap, hybrid) in order for networking to operate correctly.h](j )}(h ``gro=[0,1]``h]h gro=[0,1]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubhXJ - sets GRO off or on. Enables receive/transmit offloads. The effect of this option depends on the host side support in the transport which is being configured. In most cases it will enable TCP segmentation and RX/TX checksumming offloads. The setting must be identical on the host side and the UML side. The UML kernel will produce warnings if it is not. For example, GRO is enabled by default on local machine interfaces (e.g. veth pairs, bridge, etc), so it should be enabled in UML in the corresponding UML transports (raw, tap, hybrid) in order for networking to operate correctly.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM&hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h%``mtu=int`` - sets the interface MTU h]h)}(h$``mtu=int`` - sets the interface MTUh](j )}(h ``mtu=int``h]hmtu=int}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj9ubh - sets the interface MTU}(hj9hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM0hj5ubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h``headroom=int`` - adjusts the default headroom (32 bytes) reserved if a packet will need to be re-encapsulated into for instance VXLAN. h]h)}(h``headroom=int`` - adjusts the default headroom (32 bytes) reserved if a packet will need to be re-encapsulated into for instance VXLAN.h](j )}(h``headroom=int``h]h headroom=int}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1j hj_ubhx - adjusts the default headroom (32 bytes) reserved if a packet will need to be re-encapsulated into for instance VXLAN.}(hj_hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM2hj[ubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hJ``vec=0`` - disable multipacket IO and fall back to packet at a time mode h]h)}(hI``vec=0`` - disable multipacket IO and fall back to packet at a time modeh](j )}(h ``vec=0``h]hvec=0}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh@ - disable multipacket IO and fall back to packet at a time mode}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM5hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]j j uh1hhhhMhjhhubeh}(h]jNah ]h"]common optionsah$]h&]uh1hhjfhhhhhMubh)}(hhh](h)}(hShared Optionsh]hShared Options}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjjuh1hhjhhhhhM9ubh)}(hhh](h)}(h``ifname=str`` Transports which bind to a local network interface have a shared option - the name of the interface to bind to. h]h)}(h~``ifname=str`` Transports which bind to a local network interface have a shared option - the name of the interface to bind to.h](j )}(h``ifname=str``h]h ifname=str}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubhp Transports which bind to a local network interface have a shared option - the name of the interface to bind to.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM;hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h``src, dst, src_port, dst_port`` - all transports which use sockets which have the notion of source and destination and/or source port and destination port use these to specify them. h]h)}(h``src, dst, src_port, dst_port`` - all transports which use sockets which have the notion of source and destination and/or source port and destination port use these to specify them.h](j )}(h ``src, dst, src_port, dst_port``h]hsrc, dst, src_port, dst_port}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh - all transports which use sockets which have the notion of source and destination and/or source port and destination port use these to specify them.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM>hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hXu``v6=[0,1]`` to specify if a v6 connection is desired for all transports which operate over IP. Additionally, for transports that have some differences in the way they operate over v4 and v6 (for example EoL2TPv3), sets the correct mode of operation. In the absence of this option, the socket type is determined based on what do the src and dst arguments resolve/parse to. h]h)}(hXt``v6=[0,1]`` to specify if a v6 connection is desired for all transports which operate over IP. Additionally, for transports that have some differences in the way they operate over v4 and v6 (for example EoL2TPv3), sets the correct mode of operation. In the absence of this option, the socket type is determined based on what do the src and dst arguments resolve/parse to.h](j )}(h ``v6=[0,1]``h]hv6=[0,1]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubhXh to specify if a v6 connection is desired for all transports which operate over IP. Additionally, for transports that have some differences in the way they operate over v4 and v6 (for example EoL2TPv3), sets the correct mode of operation. In the absence of this option, the socket type is determined based on what do the src and dst arguments resolve/parse to.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMBhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]j j uh1hhhhM;hjhhubeh}(h]jpah ]h"]shared optionsah$]h&]uh1hhjfhhhhhM9ubh)}(hhh](h)}(h tap transporth]h tap transport}(hjJhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjGhhhhhMJubh)}(h Example::h]hExample:}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMLhjGhhubj )}(h.vecX:transport=tap,ifname=tap0,depth=128,gro=1h]h.vecX:transport=tap,ifname=tap0,depth=128,gro=1}hjfsbah}(h]h ]h"]h$]h&]hhuh1j hhhMNhjGhhubh)}(hnThis will connect vec0 to tap0 on the host. Tap0 must already exist (for example created using tunctl) and UP.h]hnThis will connect vec0 to tap0 on the host. Tap0 must already exist (for example created using tunctl) and UP.}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMPhjGhhubh)}(htap0 can be configured as a point-to-point interface and given an IP address so that UML can talk to the host. Alternatively, it is possible to connect UML to a tap interface which is connected to a bridge.h]htap0 can be configured as a point-to-point interface and given an IP address so that UML can talk to the host. Alternatively, it is possible to connect UML to a tap interface which is connected to a bridge.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMShjGhhubh)}(hXWhile tap relies on the vector infrastructure, it is not a true vector transport at this point, because Linux does not support multi-packet IO on tap file descriptors for normal userspace apps like UML. This is a privilege which is offered only to something which can hook up to it at kernel level via specialized interfaces like vhost-net. A vhost-net like helper for UML is planned at some point in the future.h]hXWhile tap relies on the vector infrastructure, it is not a true vector transport at this point, because Linux does not support multi-packet IO on tap file descriptors for normal userspace apps like UML. This is a privilege which is offered only to something which can hook up to it at kernel level via specialized interfaces like vhost-net. A vhost-net like helper for UML is planned at some point in the future.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMWhjGhhubh)}(h3Privileges required: tap transport requires either:h]h3Privileges required: tap transport requires either:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM^hjGhhubh)}(hhh](h)}(htap interface to exist and be created persistent and owned by the UML user using tunctl. Example ``tunctl -u uml-user -t tap0`` h]h)}(htap interface to exist and be created persistent and owned by the UML user using tunctl. Example ``tunctl -u uml-user -t tap0``h](hatap interface to exist and be created persistent and owned by the UML user using tunctl. Example }(hjhhhNhNubj )}(h``tunctl -u uml-user -t tap0``h]htunctl -u uml-user -t tap0}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1hhhhM`hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h+binary to have ``CAP_NET_ADMIN`` privilege h]h)}(h*binary to have ``CAP_NET_ADMIN`` privilegeh](hbinary to have }(hjhhhNhNubj )}(h``CAP_NET_ADMIN``h]h CAP_NET_ADMIN}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh privilege}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMchjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]j j uh1hhhhM`hjGhhubeh}(h]jah ]h"] tap transportah$]h&]uh1hhjfhhhhhMJubh)}(hhh](h)}(hhybrid transporth]hhybrid transport}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhj hhhhhMfubh)}(h Example::h]hExample:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhhj hhubj )}(h1vecX:transport=hybrid,ifname=tap0,depth=128,gro=1h]h1vecX:transport=hybrid,ifname=tap0,depth=128,gro=1}hj+sbah}(h]h ]h"]h$]h&]hhuh1j hhhMjhj hhubh)}(hThis is an experimental/demo transport which couples tap for transmit and a raw socket for receive. The raw socket allows multi-packet receive resulting in significantly higher packet rates than normal tap.h]hThis is an experimental/demo transport which couples tap for transmit and a raw socket for receive. The raw socket allows multi-packet receive resulting in significantly higher packet rates than normal tap.}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMlhj hhubh)}(hPrivileges required: hybrid requires ``CAP_NET_RAW`` capability by the UML user as well as the requirements for the tap transport.h](h%Privileges required: hybrid requires }(hjGhhhNhNubj )}(h``CAP_NET_RAW``h]h CAP_NET_RAW}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjGubhN capability by the UML user as well as the requirements for the tap transport.}(hjGhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMphj hhubeh}(h]jah ]h"]hybrid transportah$]h&]uh1hhjfhhhhhMfubh)}(hhh](h)}(hraw socket transporth]hraw socket transport}(hjqhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjnhhhhhMtubh)}(h Example::h]hExample:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMvhjnhhubj )}(h1vecX:transport=raw,ifname=p-veth0,depth=128,gro=1h]h1vecX:transport=raw,ifname=p-veth0,depth=128,gro=1}hjsbah}(h]h ]h"]h$]h&]hhuh1j hhhMxhjnhhubh)}(hThis transport uses vector IO on raw sockets. While you can bind to any interface including a physical one, the most common use it to bind to the "peer" side of a veth pair with the other side configured on the host.h]hThis transport uses vector IO on raw sockets. While you can bind to any interface including a physical one, the most common use it to bind to the “peer” side of a veth pair with the other side configured on the host.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM{hjnhhubh)}(h&Example host configuration for Debian:h]h&Example host configuration for Debian:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjnhhubh)}(h**/etc/network/interfaces**::h](j )}(h**/etc/network/interfaces**h]h/etc/network/interfaces}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjnhhubj )}(hauto veth0 iface veth0 inet static address 192.168.4.1 netmask 255.255.255.252 broadcast 192.168.4.3 pre-up ip link add veth0 type veth peer name p-veth0 && \ ifconfig p-veth0 uph]hauto veth0 iface veth0 inet static address 192.168.4.1 netmask 255.255.255.252 broadcast 192.168.4.3 pre-up ip link add veth0 type veth peer name p-veth0 && \ ifconfig p-veth0 up}hjsbah}(h]h ]h"]h$]h&]hhuh1j hhhMhjnhhubh)}(h'UML can now bind to p-veth0 like this::h]h&UML can now bind to p-veth0 like this:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjnhhubj )}(h1vec0:transport=raw,ifname=p-veth0,depth=128,gro=1h]h1vec0:transport=raw,ifname=p-veth0,depth=128,gro=1}hjsbah}(h]h ]h"]h$]h&]hhuh1j hhhMhjnhhubh)}(hpIf the UML guest is configured with 192.168.4.2 and netmask 255.255.255.0 it can talk to the host on 192.168.4.1h]hpIf the UML guest is configured with 192.168.4.2 and netmask 255.255.255.0 it can talk to the host on 192.168.4.1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjnhhubh)}(hThe raw transport also provides some support for offloading some of the filtering to the host. The two options to control it are:h]hThe raw transport also provides some support for offloading some of the filtering to the host. The two options to control it are:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjnhhubh)}(hhh](h)}(hI``bpffile=str`` filename of raw bpf code to be loaded as a socket filter h]h)}(hH``bpffile=str`` filename of raw bpf code to be loaded as a socket filterh](j )}(h``bpffile=str``h]h bpffile=str}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh9 filename of raw bpf code to be loaded as a socket filter}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h``bpfflash=int`` 0/1 allow loading of bpf from inside User Mode Linux. This option allows the use of the ethtool load firmware command to load bpf code. h]h)}(h``bpfflash=int`` 0/1 allow loading of bpf from inside User Mode Linux. This option allows the use of the ethtool load firmware command to load bpf code.h](j )}(h``bpfflash=int``h]h bpfflash=int}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjFubh 0/1 allow loading of bpf from inside User Mode Linux. This option allows the use of the ethtool load firmware command to load bpf code.}(hjFhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjBubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]j j uh1hhhhMhjnhhubh)}(hIn either case the bpf code is loaded into the host kernel. While this is presently limited to legacy bpf syntax (not ebpf), it is still a security risk. It is not recommended to allow this unless the User Mode Linux instance is considered trusted.h]hIn either case the bpf code is loaded into the host kernel. While this is presently limited to legacy bpf syntax (not ebpf), it is still a security risk. It is not recommended to allow this unless the User Mode Linux instance is considered trusted.}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjnhhubh)}(hLPrivileges required: raw socket transport requires `CAP_NET_RAW` capability.h](h3Privileges required: raw socket transport requires }(hj|hhhNhNubhtitle_reference)}(h `CAP_NET_RAW`h]h CAP_NET_RAW}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj|ubh capability.}(hj|hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjnhhubeh}(h]jah ]h"]raw socket transportah$]h&]uh1hhjfhhhhhMtubh)}(hhh](h)}(hGRE socket transporth]hGRE socket transport}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjhhhhhMubh)}(h Example::h]hExample:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj )}(h.vecX:transport=gre,src=$src_host,dst=$dst_hosth]h.vecX:transport=gre,src=$src_host,dst=$dst_host}hjsbah}(h]h ]h"]h$]h&]hhuh1j hhhMhjhhubh)}(hThis will configure an Ethernet over ``GRE`` (aka ``GRETAP`` or ``GREIRB``) tunnel which will connect the UML instance to a ``GRE`` endpoint at host dst_host. ``GRE`` supports the following additional options:h](h%This will configure an Ethernet over }(hjhhhNhNubj )}(h``GRE``h]hGRE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh (aka }(hjhhhNhNubj )}(h ``GRETAP``h]hGRETAP}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh or }(hjhhhNhNubj )}(h ``GREIRB``h]hGREIRB}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh2) tunnel which will connect the UML instance to a }(hjhhhNhNubj )}(h``GRE``h]hGRE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh endpoint at host dst_host. }(hjhhhNhNubj )}(h``GRE``h]hGRE}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh+ supports the following additional options:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hhh](h)}(hZ``rx_key=int`` - GRE 32-bit integer key for rx packets, if set, ``txkey`` must be set too h]h)}(hY``rx_key=int`` - GRE 32-bit integer key for rx packets, if set, ``txkey`` must be set tooh](j )}(h``rx_key=int``h]h rx_key=int}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjAubh2 - GRE 32-bit integer key for rx packets, if set, }(hjAhhhNhNubj )}(h ``txkey``h]htxkey}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjAubh must be set too}(hjAhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj=ubah}(h]h ]h"]h$]h&]uh1hhj:hhhhhNubh)}(hZ``tx_key=int`` - GRE 32-bit integer key for tx packets, if set ``rx_key`` must be set too h]h)}(hY``tx_key=int`` - GRE 32-bit integer key for tx packets, if set ``rx_key`` must be set tooh](j )}(h``tx_key=int``h]h tx_key=int}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjyubh1 - GRE 32-bit integer key for tx packets, if set }(hjyhhhNhNubj )}(h ``rx_key``h]hrx_key}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjyubh must be set too}(hjyhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjuubah}(h]h ]h"]h$]h&]uh1hhj:hhhhhNubh)}(h)``sequence=[0,1]`` - enable GRE sequence h]h)}(h(``sequence=[0,1]`` - enable GRE sequenceh](j )}(h``sequence=[0,1]``h]hsequence=[0,1]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh - enable GRE sequence}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhj:hhhhhNubh)}(h``pin_sequence=[0,1]`` - pretend that the sequence is always reset on each packet (needed to interoperate with some really broken implementations) h]h)}(h``pin_sequence=[0,1]`` - pretend that the sequence is always reset on each packet (needed to interoperate with some really broken implementations)h](j )}(h``pin_sequence=[0,1]``h]hpin_sequence=[0,1]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh| - pretend that the sequence is always reset on each packet (needed to interoperate with some really broken implementations)}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhj:hhhhhNubh)}(h7``v6=[0,1]`` - force IPv4 or IPv6 sockets respectively h]h)}(h6``v6=[0,1]`` - force IPv4 or IPv6 sockets respectivelyh](j )}(h ``v6=[0,1]``h]hv6=[0,1]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh* - force IPv4 or IPv6 sockets respectively}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhj:hhhhhNubh)}(h(GRE checksum is not presently supported h]h)}(h'GRE checksum is not presently supportedh]h'GRE checksum is not presently supported}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhj:hhhhhNubeh}(h]h ]h"]h$]h&]j j uh1hhhhMhjhhubh)}(hGRE has a number of caveats:h]hGRE has a number of caveats:}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hhh](h)}(hYou can use only one GRE connection per IP address. There is no way to multiplex connections as each GRE tunnel is terminated directly on the UML instance. h]h)}(hYou can use only one GRE connection per IP address. There is no way to multiplex connections as each GRE tunnel is terminated directly on the UML instance.h]hYou can use only one GRE connection per IP address. There is no way to multiplex connections as each GRE tunnel is terminated directly on the UML instance.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjNubah}(h]h ]h"]h$]h&]uh1hhjKhhhhhNubh)}(hThe key is not really a security feature. While it was intended as such its "security" is laughable. It is, however, a useful feature to ensure that the tunnel is not misconfigured. h]h)}(hThe key is not really a security feature. While it was intended as such its "security" is laughable. It is, however, a useful feature to ensure that the tunnel is not misconfigured.h]hThe key is not really a security feature. While it was intended as such its “security” is laughable. It is, however, a useful feature to ensure that the tunnel is not misconfigured.}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjfubah}(h]h ]h"]h$]h&]uh1hhjKhhhhhNubeh}(h]h ]h"]h$]h&]j j uh1hhhhMhjhhubh)}(h}An example configuration for a Linux host with a local address of 192.168.128.1 to connect to a UML instance at 192.168.129.1h]h}An example configuration for a Linux host with a local address of 192.168.128.1 to connect to a UML instance at 192.168.129.1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h**/etc/network/interfaces**::h](j )}(h**/etc/network/interfaces**h]h/etc/network/interfaces}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj )}(hauto gt0 iface gt0 inet static address 10.0.0.1 netmask 255.255.255.0 broadcast 10.0.0.255 mtu 1500 pre-up ip link add gt0 type gretap local 192.168.128.1 \ remote 192.168.129.1 || true down ip link del gt0 || trueh]hauto gt0 iface gt0 inet static address 10.0.0.1 netmask 255.255.255.0 broadcast 10.0.0.255 mtu 1500 pre-up ip link add gt0 type gretap local 192.168.128.1 \ remote 192.168.129.1 || true down ip link del gt0 || true}hjsbah}(h]h ]h"]h$]h&]hhuh1j hhhMhjhhubh)}(hHAdditionally, GRE has been tested versus a variety of network equipment.h]hHAdditionally, GRE has been tested versus a variety of network equipment.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h1Privileges required: GRE requires ``CAP_NET_RAW``h](h"Privileges required: GRE requires }(hjhhhNhNubj )}(h``CAP_NET_RAW``h]h CAP_NET_RAW}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]jah ]h"]gre socket transportah$]h&]uh1hhjfhhhhhMubh)}(hhh](h)}(hl2tpv3 socket transporth]hl2tpv3 socket transport}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjhhhhhMubh)}(hX_Warning_. L2TPv3 has a "bug". It is the "bug" known as "has more options than GNU ls". While it has some advantages, there are usually easier (and less verbose) ways to connect a UML instance to something. For example, most devices which support L2TPv3 also support GRE.h]hX_Warning_. L2TPv3 has a “bug”. It is the “bug” known as “has more options than GNU ls”. While it has some advantages, there are usually easier (and less verbose) ways to connect a UML instance to something. For example, most devices which support L2TPv3 also support GRE.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h Example::h]hExample:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj )}(hvec0:transport=l2tpv3,udp=1,src=$src_host,dst=$dst_host,srcport=$src_port,dstport=$dst_port,depth=128,rx_session=0xffffffff,tx_session=0xffffh]hvec0:transport=l2tpv3,udp=1,src=$src_host,dst=$dst_host,srcport=$src_port,dstport=$dst_port,depth=128,rx_session=0xffffffff,tx_session=0xffff}hjsbah}(h]h ]h"]h$]h&]hhuh1j hhhMhjhhubh)}(hThis will configure an Ethernet over L2TPv3 fixed tunnel which will connect the UML instance to a L2TPv3 endpoint at host $dst_host using the L2TPv3 UDP flavour and UDP destination port $dst_port.h]hThis will configure an Ethernet over L2TPv3 fixed tunnel which will connect the UML instance to a L2TPv3 endpoint at host $dst_host using the L2TPv3 UDP flavour and UDP destination port $dst_port.}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h8L2TPv3 always requires the following additional options:h]h8L2TPv3 always requires the following additional options:}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hhh](h)}(hB``rx_session=int`` - l2tpv3 32-bit integer session for rx packets h]h)}(hA``rx_session=int`` - l2tpv3 32-bit integer session for rx packetsh](j )}(h``rx_session=int``h]hrx_session=int}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjKubh/ - l2tpv3 32-bit integer session for rx packets}(hjKhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjGubah}(h]h ]h"]h$]h&]uh1hhjDhhhhhNubh)}(hB``tx_session=int`` - l2tpv3 32-bit integer session for tx packets h]h)}(hA``tx_session=int`` - l2tpv3 32-bit integer session for tx packetsh](j )}(h``tx_session=int``h]htx_session=int}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjqubh/ - l2tpv3 32-bit integer session for tx packets}(hjqhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjmubah}(h]h ]h"]h$]h&]uh1hhjDhhhhhNubeh}(h]h ]h"]h$]h&]j j uh1hhhhMhjhhubh)}(hXAs the tunnel is fixed these are not negotiated and they are preconfigured on both ends.h]hXAs the tunnel is fixed these are not negotiated and they are preconfigured on both ends.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h@Additionally, L2TPv3 supports the following optional parameters.h]h@Additionally, L2TPv3 supports the following optional parameters.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hhh](h)}(h``rx_cookie=int`` - l2tpv3 32-bit integer cookie for rx packets - same functionality as GRE key, more to prevent misconfiguration than provide actual security h]h)}(h``rx_cookie=int`` - l2tpv3 32-bit integer cookie for rx packets - same functionality as GRE key, more to prevent misconfiguration than provide actual securityh](j )}(h``rx_cookie=int``h]h rx_cookie=int}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh - l2tpv3 32-bit integer cookie for rx packets - same functionality as GRE key, more to prevent misconfiguration than provide actual security}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h@``tx_cookie=int`` - l2tpv3 32-bit integer cookie for tx packets h]h)}(h?``tx_cookie=int`` - l2tpv3 32-bit integer cookie for tx packetsh](j )}(h``tx_cookie=int``h]h tx_cookie=int}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh. - l2tpv3 32-bit integer cookie for tx packets}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h;``cookie64=[0,1]`` - use 64-bit cookies instead of 32-bit. h]h)}(h:``cookie64=[0,1]`` - use 64-bit cookies instead of 32-bit.h](j )}(h``cookie64=[0,1]``h]hcookie64=[0,1]}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh( - use 64-bit cookies instead of 32-bit.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h*``counter=[0,1]`` - enable l2tpv3 counter h]h)}(h)``counter=[0,1]`` - enable l2tpv3 counterh](j )}(h``counter=[0,1]``h]h counter=[0,1]}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj.ubh - enable l2tpv3 counter}(hj.hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj*ubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h``pin_counter=[0,1]`` - pretend that the counter is always reset on each packet (needed to interoperate with some really broken implementations) h]h)}(h``pin_counter=[0,1]`` - pretend that the counter is always reset on each packet (needed to interoperate with some really broken implementations)h](j )}(h``pin_counter=[0,1]``h]hpin_counter=[0,1]}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjTubh{ - pretend that the counter is always reset on each packet (needed to interoperate with some really broken implementations)}(hjThhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjPubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(h ``v6=[0,1]`` - force v6 sockets h]h)}(h``v6=[0,1]`` - force v6 socketsh](j )}(h ``v6=[0,1]``h]hv6=[0,1]}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjzubh - force v6 sockets}(hjzhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjvubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hG``udp=[0,1]`` - use raw sockets (0) or UDP (1) version of the protocol h]h)}(hF``udp=[0,1]`` - use raw sockets (0) or UDP (1) version of the protocolh](j )}(h ``udp=[0,1]``h]h udp=[0,1]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh9 - use raw sockets (0) or UDP (1) version of the protocol}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]j j uh1hhhhMhjhhubh)}(hL2TPv3 has a number of caveats:h]hL2TPv3 has a number of caveats:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjhhubh)}(hhh]h)}(hyou can use only one connection per IP address in raw mode. There is no way to multiplex connections as each L2TPv3 tunnel is terminated directly on the UML instance. UDP mode can use different ports for this purpose. h]h)}(hyou can use only one connection per IP address in raw mode. There is no way to multiplex connections as each L2TPv3 tunnel is terminated directly on the UML instance. UDP mode can use different ports for this purpose.h]hyou can use only one connection per IP address in raw mode. There is no way to multiplex connections as each L2TPv3 tunnel is terminated directly on the UML instance. UDP mode can use different ports for this purpose.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubah}(h]h ]h"]h$]h&]j j uh1hhhhMhjhhubh)}(hQHere is an example of how to configure a Linux host to connect to UML via L2TPv3:h]hQHere is an example of how to configure a Linux host to connect to UML via L2TPv3:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h**/etc/network/interfaces**::h](j )}(h**/etc/network/interfaces**h]h/etc/network/interfaces}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj )}(hXauto l2tp1 iface l2tp1 inet static address 192.168.126.1 netmask 255.255.255.0 broadcast 192.168.126.255 mtu 1500 pre-up ip l2tp add tunnel remote 127.0.0.1 \ local 127.0.0.1 encap udp tunnel_id 2 \ peer_tunnel_id 2 udp_sport 1706 udp_dport 1707 && \ ip l2tp add session name l2tp1 tunnel_id 2 \ session_id 0xffffffff peer_session_id 0xffffffff down ip l2tp del session tunnel_id 2 session_id 0xffffffff && \ ip l2tp del tunnel tunnel_id 2h]hXauto l2tp1 iface l2tp1 inet static address 192.168.126.1 netmask 255.255.255.0 broadcast 192.168.126.255 mtu 1500 pre-up ip l2tp add tunnel remote 127.0.0.1 \ local 127.0.0.1 encap udp tunnel_id 2 \ peer_tunnel_id 2 udp_sport 1706 udp_dport 1707 && \ ip l2tp add session name l2tp1 tunnel_id 2 \ session_id 0xffffffff peer_session_id 0xffffffff down ip l2tp del session tunnel_id 2 session_id 0xffffffff && \ ip l2tp del tunnel tunnel_id 2}hj!sbah}(h]h ]h"]h$]h&]hhuh1j hhhMhjhhubh)}(hpPrivileges required: L2TPv3 requires ``CAP_NET_RAW`` for raw IP mode and no special privileges for the UDP mode.h](h%Privileges required: L2TPv3 requires }(hj/hhhNhNubj )}(h``CAP_NET_RAW``h]h CAP_NET_RAW}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj/ubh< for raw IP mode and no special privileges for the UDP mode.}(hj/hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM'hjhhubeh}(h]jah ]h"]l2tpv3 socket transportah$]h&]uh1hhjfhhhhhMubh)}(hhh](h)}(hBESS socket transporth]hBESS socket transport}(hjYhhhNhNubah}(h]h ]h"]h$]h&]jj6uh1hhjVhhhhhM+ubh)}(h2BESS is a high performance modular network switch.h]h2BESS is a high performance modular network switch.}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM-hjVhhubh)}(hhttps://github.com/NetSys/bessh]h)}(hjwh]hhttps://github.com/NetSys/bess}(hjyhhhNhNubah}(h]h ]h"]h$]h&]refurijwuh1hhjuubah}(h]h ]h"]h$]h&]uh1hhhhM/hjVhhubh)}(hIt has support for a simple sequential packet socket mode which in the more recent versions is using vector IO for high performance.h]hIt has support for a simple sequential packet socket mode which in the more recent versions is using vector IO for high performance.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM1hjVhhubh)}(h Example::h]hExample:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM4hjVhhubj )}(h/vecX:transport=bess,src=$unix_src,dst=$unix_dsth]h/vecX:transport=bess,src=$unix_src,dst=$unix_dst}hjsbah}(h]h ]h"]h$]h&]hhuh1j hhhM6hjVhhubh)}(hThis will configure a BESS transport using the unix_src Unix domain socket address as source and unix_dst socket address as destination.h]hThis will configure a BESS transport using the unix_src Unix domain socket address as source and unix_dst socket address as destination.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM8hjVhhubh)}(hlFor BESS configuration and how to allocate a BESS Unix domain socket port please see the BESS documentation.h]hlFor BESS configuration and how to allocate a BESS Unix domain socket port please see the BESS documentation.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM;hjVhhubh)}(h>https://github.com/NetSys/bess/wiki/Built-In-Modules-and-Portsh]h)}(hjh]h>https://github.com/NetSys/bess/wiki/Built-In-Modules-and-Ports}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1hhjubah}(h]h ]h"]h$]h&]uh1hhhhM>hjVhhubh)}(h7BESS transport does not require any special privileges.h]h7BESS transport does not require any special privileges.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM@hjVhhubeh}(h]j<ah ]h"]bess socket transportah$]h&]uh1hhjfhhhhhM+ubh)}(hhh](h)}(hVDE vector transporth]hVDE vector transport}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjXuh1hhjhhhhhMCubh)}(hVirtual Distributed Ethernet (VDE) is a project whose main goal is to provide a highly flexible support for virtual networking.h]hVirtual Distributed Ethernet (VDE) is a project whose main goal is to provide a highly flexible support for virtual networking.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMEhjhhubh)}(h3http://wiki.virtualsquare.org/#/tutorials/vdebasicsh]h)}(hj!h]h3http://wiki.virtualsquare.org/#/tutorials/vdebasics}(hj#hhhNhNubah}(h]h ]h"]h$]h&]refurij!uh1hhjubah}(h]h ]h"]h$]h&]uh1hhhhMHhjhhubh)}(h;Common usages of VDE include fast prototyping and teaching.h]h;Common usages of VDE include fast prototyping and teaching.}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMJhjhhubh)}(h Examples:h]h Examples:}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMLhjhhubh block_quote)}(h&``vecX:transport=vde,vnl=tap://tap0`` h]h)}(h%``vecX:transport=vde,vnl=tap://tap0``h]j )}(hj[h]h!vecX:transport=vde,vnl=tap://tap0}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjYubah}(h]h ]h"]h$]h&]uh1hhhhMNhjUubah}(h]h ]h"]h$]h&]uh1jShhhMNhjhhubh)}(huse tap0h]huse tap0}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMPhjhhubjT)}(h$``vecX:transport=vde,vnl=slirp://`` h]h)}(h#``vecX:transport=vde,vnl=slirp://``h]j )}(hjh]hvecX:transport=vde,vnl=slirp://}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhMRhjubah}(h]h ]h"]h$]h&]uh1jShhhMRhjhhubh)}(h use slirph]h use slirp}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMThjhhubjT)}(h-``vec0:transport=vde,vnl=vde:///tmp/switch`` h]h)}(h,``vec0:transport=vde,vnl=vde:///tmp/switch``h]j )}(hjh]h(vec0:transport=vde,vnl=vde:///tmp/switch}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhMVhjubah}(h]h ]h"]h$]h&]uh1jShhhMVhjhhubh)}(hconnect to a vde switchh]hconnect to a vde switch}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMXhjhhubjT)}(hC``vecX:transport=\"vde,vnl=cmd://ssh remote.host //tmp/sshlirp\"`` h]h)}(hB``vecX:transport=\"vde,vnl=cmd://ssh remote.host //tmp/sshlirp\"``h]j )}(hB``vecX:transport=\"vde,vnl=cmd://ssh remote.host //tmp/sshlirp\"``h]h>vecX:transport=\"vde,vnl=cmd://ssh remote.host //tmp/sshlirp\"}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubah}(h]h ]h"]h$]h&]uh1hhhhMZhjubah}(h]h ]h"]h$]h&]uh1jShhhMZhjhhubh)}(huconnect to a remote slirp (instant VPN: convert ssh to VPN, it uses sshlirp) https://github.com/virtualsquare/sshlirph](hMconnect to a remote slirp (instant VPN: convert ssh to VPN, it uses sshlirp) }(hjhhhNhNubh)}(h(https://github.com/virtualsquare/sshlirph]h(https://github.com/virtualsquare/sshlirp}(hj hhhNhNubah}(h]h ]h"]h$]h&]refurijuh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhM\hjhhubjT)}(h-``vec0:transport=vde,vnl=vxvde://234.0.0.1`` h]h)}(h,``vec0:transport=vde,vnl=vxvde://234.0.0.1``h]j )}(hj'h]h(vec0:transport=vde,vnl=vxvde://234.0.0.1}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj%ubah}(h]h ]h"]h$]h&]uh1hhhhM_hj!ubah}(h]h ]h"]h$]h&]uh1jShhhM_hjhhubh)}(hconnect to a local area cloud (all the UML nodes using the same multicast address running on hosts in the same multicast domain (LAN) will be automagically connected together to a virtual LAN.h]hconnect to a local area cloud (all the UML nodes using the same multicast address running on hosts in the same multicast domain (LAN) will be automagically connected together to a virtual LAN.}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMahjhhubeh}(h]j^ah ]h"]vde vector transportah$]h&]uh1hhjfhhhhhMCubeh}(h]j/ah ]h"]configuring vector transportsah$]h&]uh1hhj' hhhhhMubh)}(hhh](h)}(hConfiguring Legacy transportsh]hConfiguring Legacy transports}(hjahhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhj^hhhhhMfubh)}(hNLegacy transports are now considered obsolete. Please use the vector versions.h]hNLegacy transports are now considered obsolete. Please use the vector versions.}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhhj^hhubeh}(h]jah ]h"]configuring legacy transportsah$]h&]uh1hhj' hhhhhMfubeh}(h]jah ]h"]setting up uml networkingah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h Running UMLh]h Running UML}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjhhhhhMmubh)}(hThis section assumes that either the user-mode-linux package from the distribution or a custom built kernel has been installed on the host.h]hThis section assumes that either the user-mode-linux package from the distribution or a custom built kernel has been installed on the host.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMohjhhubh)}(hXThese add an executable called linux to the system. This is the UML kernel. It can be run just like any other executable. It will take most normal linux kernel arguments as command line arguments. Additionally, it will need some UML-specific arguments in order to do something useful.h]hXThese add an executable called linux to the system. This is the UML kernel. It can be run just like any other executable. It will take most normal linux kernel arguments as command line arguments. Additionally, it will need some UML-specific arguments in order to do something useful.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMrhjhhubh)}(hhh](h)}(h Argumentsh]h Arguments}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjhhhhhMyubh)}(hhh](h)}(hMandatory Arguments:h]hMandatory Arguments:}(hjhhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjhhhhhM|ubh)}(hhh](h)}(hf``mem=int[K,M,G]`` - amount of memory. By default in bytes. It will also accept K, M or G qualifiers. h]h)}(he``mem=int[K,M,G]`` - amount of memory. By default in bytes. It will also accept K, M or G qualifiers.h](j )}(h``mem=int[K,M,G]``h]hmem=int[K,M,G]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubhS - amount of memory. By default in bytes. It will also accept K, M or G qualifiers.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM~hjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hX_``ubdX[s,d,c,t]=`` virtual disk specification. This is not really mandatory, but it is likely to be needed in nearly all cases so we can specify a root file system. The simplest possible image specification is the name of the image file for the filesystem (created using one of the methods described in `Creating an image`_). * UBD devices support copy on write (COW). The changes are kept in a separate file which can be discarded allowing a rollback to the original pristine image. If COW is desired, the UBD image is specified as: ``cow_file,master_image``. Example:``ubd0=Filesystem.cow,Filesystem.img`` * UBD devices can be set to use synchronous IO. Any writes are immediately flushed to disk. This is done by adding ``s`` after the ``ubdX`` specification. * UBD performs some heuristics on devices specified as a single filename to make sure that a COW file has not been specified as the image. To turn them off, use the ``d`` flag after ``ubdX``. * UBD supports TRIM - asking the Host OS to reclaim any unused blocks in the image. To turn it off, specify the ``t`` flag after ``ubdX``. h](h)}(hXE``ubdX[s,d,c,t]=`` virtual disk specification. This is not really mandatory, but it is likely to be needed in nearly all cases so we can specify a root file system. The simplest possible image specification is the name of the image file for the filesystem (created using one of the methods described in `Creating an image`_).h](j )}(h``ubdX[s,d,c,t]=``h]hubdX[s,d,c,t]=}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubhX virtual disk specification. This is not really mandatory, but it is likely to be needed in nearly all cases so we can specify a root file system. The simplest possible image specification is the name of the image file for the filesystem (created using one of the methods described in }(hjhhhNhNubh)}(h`Creating an image`_h]hCreating an image}(hjhhhNhNubah}(h]h ]h"]h$]h&]nameCreating an imagejjuh1hhjresolvedKubh).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hhh](h)}(hXUBD devices support copy on write (COW). The changes are kept in a separate file which can be discarded allowing a rollback to the original pristine image. If COW is desired, the UBD image is specified as: ``cow_file,master_image``. Example:``ubd0=Filesystem.cow,Filesystem.img`` h]h)}(hXUBD devices support copy on write (COW). The changes are kept in a separate file which can be discarded allowing a rollback to the original pristine image. If COW is desired, the UBD image is specified as: ``cow_file,master_image``. Example:``ubd0=Filesystem.cow,Filesystem.img``h](hUBD devices support copy on write (COW). The changes are kept in a separate file which can be discarded allowing a rollback to the original pristine image. If COW is desired, the UBD image is specified as: }(hj?hhhNhNubj )}(h``cow_file,master_image``h]hcow_file,master_image}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1j hj?ubh . Example:}(hj?hhhNhNubj )}(h&``ubd0=Filesystem.cow,Filesystem.img``h]h"ubd0=Filesystem.cow,Filesystem.img}(hjYhhhNhNubah}(h]h ]h"]h$]h&]uh1j hj?ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj;ubah}(h]h ]h"]h$]h&]uh1hhj8ubh)}(hUBD devices can be set to use synchronous IO. Any writes are immediately flushed to disk. This is done by adding ``s`` after the ``ubdX`` specification. h]h)}(hUBD devices can be set to use synchronous IO. Any writes are immediately flushed to disk. This is done by adding ``s`` after the ``ubdX`` specification.h](hqUBD devices can be set to use synchronous IO. Any writes are immediately flushed to disk. This is done by adding }(hjwhhhNhNubj )}(h``s``h]hs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjwubh after the }(hjwhhhNhNubj )}(h``ubdX``h]hubdX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjwubh specification.}(hjwhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjsubah}(h]h ]h"]h$]h&]uh1hhj8ubh)}(hUBD performs some heuristics on devices specified as a single filename to make sure that a COW file has not been specified as the image. To turn them off, use the ``d`` flag after ``ubdX``. h]h)}(hUBD performs some heuristics on devices specified as a single filename to make sure that a COW file has not been specified as the image. To turn them off, use the ``d`` flag after ``ubdX``.h](hUBD performs some heuristics on devices specified as a single filename to make sure that a COW file has not been specified as the image. To turn them off, use the }(hjhhhNhNubj )}(h``d``h]hd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh flag after }(hjhhhNhNubj )}(h``ubdX``h]hubdX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhj8ubh)}(hUBD supports TRIM - asking the Host OS to reclaim any unused blocks in the image. To turn it off, specify the ``t`` flag after ``ubdX``. h]h)}(hUBD supports TRIM - asking the Host OS to reclaim any unused blocks in the image. To turn it off, specify the ``t`` flag after ``ubdX``.h](hnUBD supports TRIM - asking the Host OS to reclaim any unused blocks in the image. To turn it off, specify the }(hjhhhNhNubj )}(h``t``h]ht}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh flag after }(hjhhhNhNubj )}(h``ubdX``h]hubdX}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1hhj8ubeh}(h]h ]h"]h$]h&]j j uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjhhhNhNubh)}(hU``root=`` root device - most likely ``/dev/ubd0`` (this is a Linux filesystem image) h]h)}(hT``root=`` root device - most likely ``/dev/ubd0`` (this is a Linux filesystem image)h](j )}(h ``root=``h]hroot=}(hj; hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj7 ubh root device - most likely }(hj7 hhhNhNubj )}(h ``/dev/ubd0``h]h /dev/ubd0}(hjM hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj7 ubh# (this is a Linux filesystem image)}(hj7 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj3 ubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]j j uh1hhhhM~hjhhubeh}(h]jah ]h"]mandatory arguments:ah$]h&]uh1hhjhhhhhM|ubh)}(hhh](h)}(hImportant Optional Argumentsh]hImportant Optional Arguments}(hj{ hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjx hhhhhMubh)}(hXzIf UML is run as "linux" with no extra arguments, it will try to start an xterm for every console configured inside the image (up to 6 in most Linux distributions). Each console is started inside an xterm. This makes it nice and easy to use UML on a host with a GUI. It is, however, the wrong approach if UML is to be used as a testing harness or run in a text-only environment.h]hX~If UML is run as “linux” with no extra arguments, it will try to start an xterm for every console configured inside the image (up to 6 in most Linux distributions). Each console is started inside an xterm. This makes it nice and easy to use UML on a host with a GUI. It is, however, the wrong approach if UML is to be used as a testing harness or run in a text-only environment.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjx hhubh)}(hIn order to change this behaviour we need to specify an alternative console and wire it to one of the supported "line" channels. For this we need to map a console to use something different from the default xterm.h]hIn order to change this behaviour we need to specify an alternative console and wire it to one of the supported “line” channels. For this we need to map a console to use something different from the default xterm.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjx hhubh)}(hhj+hhubj )}(htmount -t tmpfs -ompol=bind:X none /mnt/tmpfs-nodeX TEMP=/mnt/tmpfs-nodeX taskset -cX linux options options options..h]htmount -t tmpfs -ompol=bind:X none /mnt/tmpfs-nodeX TEMP=/mnt/tmpfs-nodeX taskset -cX linux options options options..}hj+sbah}(h]h ]h"]h$]h&]hhuh1j hhhMHhj+hhubeh}(h]jah ]h"] tuning umlah$]h&]uh1hhjM'hhhhhM1ubeh}(h]j9ah ]h"]advanced uml topicsah$]h&]uh1hhhhhhhhMubh)}(hhh](h)}(h+Contributing to UML and Developing with UMLh]h+Contributing to UML and Developing with UML}(hj+hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhj+hhhhhMMubh)}(hUML is an excellent platform to develop new Linux kernel concepts - filesystems, devices, virtualization, etc. It provides unrivalled opportunities to create and test them without being constrained to emulating specific hardware.h]hUML is an excellent platform to develop new Linux kernel concepts - filesystems, devices, virtualization, etc. It provides unrivalled opportunities to create and test them without being constrained to emulating specific hardware.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMOhj+hhubh)}(hMExample - want to try how Linux will work with 4096 "proper" network devices?h]hQExample - want to try how Linux will work with 4096 “proper” network devices?}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMThj+hhubh)}(hNot an issue with UML. At the same time, this is something which is difficult with other virtualization packages - they are constrained by the number of devices allowed on the hardware bus they are trying to emulate (for example 16 on a PCI bus in qemu).h]hNot an issue with UML. At the same time, this is something which is difficult with other virtualization packages - they are constrained by the number of devices allowed on the hardware bus they are trying to emulate (for example 16 on a PCI bus in qemu).}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMWhj+hhubh)}(hIf you have something to contribute such as a patch, a bugfix, a new feature, please send it to ``linux-um@lists.infradead.org``.h](h`If you have something to contribute such as a patch, a bugfix, a new feature, please send it to }(hj,hhhNhNubj )}(h ``linux-um@lists.infradead.org``h]hlinux-um@lists.infradead.org}(hj ,hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj,ubh.}(hj,hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM\hj+hhubh)}(hPlease follow all standard Linux patch guidelines such as cc-ing relevant maintainers and run ``./scripts/checkpatch.pl`` on your patch. For more details see ``Documentation/process/submitting-patches.rst``h](h^Please follow all standard Linux patch guidelines such as cc-ing relevant maintainers and run }(hj#,hhhNhNubj )}(h``./scripts/checkpatch.pl``h]h./scripts/checkpatch.pl}(hj+,hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj#,ubh% on your patch. For more details see }(hj#,hhhNhNubj )}(h0``Documentation/process/submitting-patches.rst``h]h,Documentation/process/submitting-patches.rst}(hj=,hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj#,ubeh}(h]h ]h"]h$]h&]uh1hhhhM_hj+hhubh)}(h`Note - the list does not accept HTML or attachments, all emails must be formatted as plain text.h]h`Note - the list does not accept HTML or attachments, all emails must be formatted as plain text.}(hjQ,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMchj+hhubh)}(hXsDeveloping always goes hand in hand with debugging. First of all, you can always run UML under gdb and there will be a whole section later on on how to do that. That, however, is not the only way to debug a Linux kernel. Quite often adding tracing statements and/or using UML specific approaches such as ptracing the UML kernel process are significantly more informative.h]hXsDeveloping always goes hand in hand with debugging. First of all, you can always run UML under gdb and there will be a whole section later on on how to do that. That, however, is not the only way to debug a Linux kernel. Quite often adding tracing statements and/or using UML specific approaches such as ptracing the UML kernel process are significantly more informative.}(hj_,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMfhj+hhubh)}(hhh](h)}(h Tracing UMLh]h Tracing UML}(hjp,hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjm,hhhhhMnubh)}(hWhen running, UML consists of a main kernel thread and a number of helper threads. The ones of interest for tracing are NOT the ones that are already ptraced by UML as a part of its MMU emulation.h]hWhen running, UML consists of a main kernel thread and a number of helper threads. The ones of interest for tracing are NOT the ones that are already ptraced by UML as a part of its MMU emulation.}(hj~,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMphjm,hhubh)}(hX6These are usually the first three threads visible in a ps display. The one with the lowest PID number and using most CPU is usually the kernel thread. The other threads are the disk (ubd) device helper thread and the SIGIO helper thread. Running ptrace on this thread usually results in the following picture::h]hX5These are usually the first three threads visible in a ps display. The one with the lowest PID number and using most CPU is usually the kernel thread. The other threads are the disk (ubd) device helper thread and the SIGIO helper thread. Running ptrace on this thread usually results in the following picture:}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMthjm,hhubj )}(hXEhost$ strace -p 16566 --- SIGIO {si_signo=SIGIO, si_code=POLL_IN, si_band=65} --- epoll_wait(4, [{EPOLLIN, {u32=3721159424, u64=3721159424}}], 64, 0) = 1 epoll_wait(4, [], 64, 0) = 0 rt_sigreturn({mask=[PIPE]}) = 16967 ptrace(PTRACE_GETREGS, 16967, NULL, 0xd5f34f38) = 0 ptrace(PTRACE_GETREGSET, 16967, NT_X86_XSTATE, [{iov_base=0xd5f35010, iov_len=832}]) = 0 ptrace(PTRACE_GETSIGINFO, 16967, NULL, {si_signo=SIGTRAP, si_code=0x85, si_pid=16967, si_uid=0}) = 0 ptrace(PTRACE_SETREGS, 16967, NULL, 0xd5f34f38) = 0 ptrace(PTRACE_SETREGSET, 16967, NT_X86_XSTATE, [{iov_base=0xd5f35010, iov_len=2696}]) = 0 ptrace(PTRACE_SYSEMU, 16967, NULL, 0) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_TRAPPED, si_pid=16967, si_uid=0, si_status=SIGTRAP, si_utime=65, si_stime=89} --- wait4(16967, [{WIFSTOPPED(s) && WSTOPSIG(s) == SIGTRAP | 0x80}], WSTOPPED|__WALL, NULL) = 16967 ptrace(PTRACE_GETREGS, 16967, NULL, 0xd5f34f38) = 0 ptrace(PTRACE_GETREGSET, 16967, NT_X86_XSTATE, [{iov_base=0xd5f35010, iov_len=832}]) = 0 ptrace(PTRACE_GETSIGINFO, 16967, NULL, {si_signo=SIGTRAP, si_code=0x85, si_pid=16967, si_uid=0}) = 0 timer_settime(0, 0, {it_interval={tv_sec=0, tv_nsec=0}, it_value={tv_sec=0, tv_nsec=2830912}}, NULL) = 0 getpid() = 16566 clock_nanosleep(CLOCK_MONOTONIC, 0, {tv_sec=1, tv_nsec=0}, NULL) = ? ERESTART_RESTARTBLOCK (Interrupted by signal) --- SIGALRM {si_signo=SIGALRM, si_code=SI_TIMER, si_timerid=0, si_overrun=0, si_value={int=1631716592, ptr=0x614204f0}} --- rt_sigreturn({mask=[PIPE]}) = -1 EINTR (Interrupted system call)h]hXEhost$ strace -p 16566 --- SIGIO {si_signo=SIGIO, si_code=POLL_IN, si_band=65} --- epoll_wait(4, [{EPOLLIN, {u32=3721159424, u64=3721159424}}], 64, 0) = 1 epoll_wait(4, [], 64, 0) = 0 rt_sigreturn({mask=[PIPE]}) = 16967 ptrace(PTRACE_GETREGS, 16967, NULL, 0xd5f34f38) = 0 ptrace(PTRACE_GETREGSET, 16967, NT_X86_XSTATE, [{iov_base=0xd5f35010, iov_len=832}]) = 0 ptrace(PTRACE_GETSIGINFO, 16967, NULL, {si_signo=SIGTRAP, si_code=0x85, si_pid=16967, si_uid=0}) = 0 ptrace(PTRACE_SETREGS, 16967, NULL, 0xd5f34f38) = 0 ptrace(PTRACE_SETREGSET, 16967, NT_X86_XSTATE, [{iov_base=0xd5f35010, iov_len=2696}]) = 0 ptrace(PTRACE_SYSEMU, 16967, NULL, 0) = 0 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_TRAPPED, si_pid=16967, si_uid=0, si_status=SIGTRAP, si_utime=65, si_stime=89} --- wait4(16967, [{WIFSTOPPED(s) && WSTOPSIG(s) == SIGTRAP | 0x80}], WSTOPPED|__WALL, NULL) = 16967 ptrace(PTRACE_GETREGS, 16967, NULL, 0xd5f34f38) = 0 ptrace(PTRACE_GETREGSET, 16967, NT_X86_XSTATE, [{iov_base=0xd5f35010, iov_len=832}]) = 0 ptrace(PTRACE_GETSIGINFO, 16967, NULL, {si_signo=SIGTRAP, si_code=0x85, si_pid=16967, si_uid=0}) = 0 timer_settime(0, 0, {it_interval={tv_sec=0, tv_nsec=0}, it_value={tv_sec=0, tv_nsec=2830912}}, NULL) = 0 getpid() = 16566 clock_nanosleep(CLOCK_MONOTONIC, 0, {tv_sec=1, tv_nsec=0}, NULL) = ? ERESTART_RESTARTBLOCK (Interrupted by signal) --- SIGALRM {si_signo=SIGALRM, si_code=SI_TIMER, si_timerid=0, si_overrun=0, si_value={int=1631716592, ptr=0x614204f0}} --- rt_sigreturn({mask=[PIPE]}) = -1 EINTR (Interrupted system call)}hj,sbah}(h]h ]h"]h$]h&]hhuh1j hhhMzhjm,hhubh)}(h:This is a typical picture from a mostly idle UML instance.h]h:This is a typical picture from a mostly idle UML instance.}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjm,hhubh)}(hhh](h)}(hUML interrupt controller uses epoll - this is UML waiting for IO interrupts: epoll_wait(4, [{EPOLLIN, {u32=3721159424, u64=3721159424}}], 64, 0) = 1 h](h)}(hLUML interrupt controller uses epoll - this is UML waiting for IO interrupts:h]hLUML interrupt controller uses epoll - this is UML waiting for IO interrupts:}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,ubjT)}(hHepoll_wait(4, [{EPOLLIN, {u32=3721159424, u64=3721159424}}], 64, 0) = 1 h]h)}(hGepoll_wait(4, [{EPOLLIN, {u32=3721159424, u64=3721159424}}], 64, 0) = 1h]hGepoll_wait(4, [{EPOLLIN, {u32=3721159424, u64=3721159424}}], 64, 0) = 1}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,ubah}(h]h ]h"]h$]h&]uh1jShhhMhj,ubeh}(h]h ]h"]h$]h&]uh1hhj,hhhhhNubh)}(hTThe sequence of ptrace calls is part of MMU emulation and running the UML userspace.h]h)}(hTThe sequence of ptrace calls is part of MMU emulation and running the UML userspace.h]hTThe sequence of ptrace calls is part of MMU emulation and running the UML userspace.}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj,ubah}(h]h ]h"]h$]h&]uh1hhj,hhhhhNubh)}(h``timer_settime`` is part of the UML high res timer subsystem mapping timer requests from inside UML onto the host high resolution timers.h]h)}(h``timer_settime`` is part of the UML high res timer subsystem mapping timer requests from inside UML onto the host high resolution timers.h](j )}(h``timer_settime``h]h timer_settime}(hj -hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj-ubhy is part of the UML high res timer subsystem mapping timer requests from inside UML onto the host high resolution timers.}(hj-hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj-ubah}(h]h ]h"]h$]h&]uh1hhj,hhhhhNubh)}(h```clock_nanosleep`` is UML going into idle (similar to the way a PC will execute an ACPI idle). h]h)}(h_``clock_nanosleep`` is UML going into idle (similar to the way a PC will execute an ACPI idle).h](j )}(h``clock_nanosleep``h]hclock_nanosleep}(hj/-hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj+-ubhL is UML going into idle (similar to the way a PC will execute an ACPI idle).}(hj+-hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj'-ubah}(h]h ]h"]h$]h&]uh1hhj,hhhhhNubeh}(h]h ]h"]h$]h&]j j uh1hhhhMhjm,hhubh)}(hAs you can see UML will generate quite a bit of output even in idle. The output can be very informative when observing IO. It shows the actual IO calls, their arguments and returns values.h]hAs you can see UML will generate quite a bit of output even in idle. The output can be very informative when observing IO. It shows the actual IO calls, their arguments and returns values.}(hjS-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjm,hhubeh}(h]jah ]h"] tracing umlah$]h&]uh1hhj+hhhhhMnubh)}(hhh](h)}(hKernel debuggingh]hKernel debugging}(hjk-hhhNhNubah}(h]h ]h"]h$]h&]jjuh1hhjh-hhhhhMubh)}(hYou can run UML under gdb now, though it will not necessarily agree to be started under it. If you are trying to track a runtime bug, it is much better to attach gdb to a running UML instance and let UML run.h]hYou can run UML under gdb now, though it will not necessarily agree to be started under it. If you are trying to track a runtime bug, it is much better to attach gdb to a running UML instance and let UML run.}(hjy-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjh-hhubh)}(hHAssuming the same PID number as in the previous example, this would be::h]hGAssuming the same PID number as in the previous example, this would be:}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjh-hhubj )}(h# gdb -p 16566h]h# gdb -p 16566}hj-sbah}(h]h ]h"]h$]h&]hhuh1j hhhMhjh-hhubh)}(hThis will STOP the UML instance, so you must enter `cont` at the GDB command line to request it to continue. It may be a good idea to make this into a gdb script and pass it to gdb as an argument.h](h3This will STOP the UML instance, so you must enter }(hj-hhhNhNubj)}(h`cont`h]hcont}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj-ubh at the GDB command line to request it to continue. It may be a good idea to make this into a gdb script and pass it to gdb as an argument.}(hj-hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjh-hhubeh}(h]j ah ]h"]kernel debuggingah$]h&]uh1hhj+hhhhhMubh)}(hhh](h)}(hDeveloping Device Driversh]hDeveloping Device Drivers}(hj-hhhNhNubah}(h]h ]h"]h$]h&]jj'uh1hhj-hhhhhMubh)}(hX\Nearly all UML drivers are monolithic. While it is possible to build a UML driver as a kernel module, that limits the possible functionality to in-kernel only and non-UML specific. The reason for this is that in order to really leverage UML, one needs to write a piece of userspace code which maps driver concepts onto actual userspace host calls.h]hX\Nearly all UML drivers are monolithic. While it is possible to build a UML driver as a kernel module, that limits the possible functionality to in-kernel only and non-UML specific. The reason for this is that in order to really leverage UML, one needs to write a piece of userspace code which maps driver concepts onto actual userspace host calls.}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj-hhubh)}(hXThis forms the so-called "user" portion of the driver. While it can reuse a lot of kernel concepts, it is generally just another piece of userspace code. This portion needs some matching "kernel" code which resides inside the UML image and which implements the Linux kernel part.h]hXThis forms the so-called “user” portion of the driver. While it can reuse a lot of kernel concepts, it is generally just another piece of userspace code. This portion needs some matching “kernel” code which resides inside the UML image and which implements the Linux kernel part.}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj-hhubh)}(hO*Note: There are very few limitations in the way "kernel" and "user" interact*.h](j_()}(hN*Note: There are very few limitations in the way "kernel" and "user" interact*h]hTNote: There are very few limitations in the way “kernel” and “user” interact}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1j^(hj-ubh.}(hj-hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj-hhubh)}(hXUML does not have a strictly defined kernel-to-host API. It does not try to emulate a specific architecture or bus. UML's "kernel" and "user" can share memory, code and interact as needed to implement whatever design the software developer has in mind. The only limitations are purely technical. Due to a lot of functions and variables having the same names, the developer should be careful which includes and libraries they are trying to refer to.h]hXUML does not have a strictly defined kernel-to-host API. It does not try to emulate a specific architecture or bus. UML’s “kernel” and “user” can share memory, code and interact as needed to implement whatever design the software developer has in mind. The only limitations are purely technical. Due to a lot of functions and variables having the same names, the developer should be careful which includes and libraries they are trying to refer to.}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj-hhubh)}(hAs a result a lot of userspace code consists of simple wrappers. E.g. ``os_close_file()`` is just a wrapper around ``close()`` which ensures that the userspace function close does not clash with similarly named function(s) in the kernel part.h](hFAs a result a lot of userspace code consists of simple wrappers. E.g. }(hj!.hhhNhNubj )}(h``os_close_file()``h]hos_close_file()}(hj).hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj!.ubh is just a wrapper around }(hj!.hhhNhNubj )}(h ``close()``h]hclose()}(hj;.hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj!.ubht which ensures that the userspace function close does not clash with similarly named function(s) in the kernel part.}(hj!.hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj-hhubeh}(h]j-ah ]h"]developing device driversah$]h&]uh1hhj+hhhhhMubh)}(hhh](h)}(hUsing UML as a Test Platformh]hUsing UML as a Test Platform}(hj].hhhNhNubah}(h]h ]h"]h$]h&]jjIuh1hhjZ.hhhhhMubh)}(hUML is an excellent test platform for device driver development. As with most things UML, "some user assembly may be required". It is up to the user to build their emulation environment. UML at present provides only the kernel infrastructure.h]hUML is an excellent test platform for device driver development. As with most things UML, “some user assembly may be required”. It is up to the user to build their emulation environment. UML at present provides only the kernel infrastructure.}(hjk.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjZ.hhubh)}(hPart of this infrastructure is the ability to load and parse fdt device tree blobs as used in Arm or Open Firmware platforms. These are supplied as an optional extra argument to the kernel command line::h]hPart of this infrastructure is the ability to load and parse fdt device tree blobs as used in Arm or Open Firmware platforms. These are supplied as an optional extra argument to the kernel command line:}(hjy.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjZ.hhubj )}(h dtb=filenameh]h dtb=filename}hj.sbah}(h]h ]h"]h$]h&]hhuh1j hhhMhjZ.hhubh)}(hThe device tree is loaded and parsed at boottime and is accessible by drivers which query it. At this moment in time this facility is intended solely for development purposes. UML's own devices do not query the device tree.h]hThe device tree is loaded and parsed at boottime and is accessible by drivers which query it. At this moment in time this facility is intended solely for development purposes. UML’s own devices do not query the device tree.}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjZ.hhubh)}(hhh](h)}(hSecurity Considerationsh]hSecurity Considerations}(hj.hhhNhNubah}(h]h ]h"]h$]h&]jjhuh1hhj.hhhhhMubh)}(hXdDrivers or any new functionality should default to not accepting arbitrary filename, bpf code or other parameters which can affect the host from inside the UML instance. For example, specifying the socket used for IPC communication between a driver and the host at the UML command line is OK security-wise. Allowing it as a loadable module parameter isn't.h]hXfDrivers or any new functionality should default to not accepting arbitrary filename, bpf code or other parameters which can affect the host from inside the UML instance. For example, specifying the socket used for IPC communication between a driver and the host at the UML command line is OK security-wise. Allowing it as a loadable module parameter isn’t.}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.hhubh)}(hIf such functionality is desirable for a particular application (e.g. loading BPF "firmware" for raw socket network transports), it should be off by default and should be explicitly turned on as a command line parameter at startup.h]hIf such functionality is desirable for a particular application (e.g. loading BPF “firmware” for raw socket network transports), it should be off by default and should be explicitly turned on as a command line parameter at startup.}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.hhubh)}(hXeEven with this in mind, the level of isolation between UML and the host is relatively weak. If the UML userspace is allowed to load arbitrary kernel drivers, an attacker can use this to break out of UML. Thus, if UML is used in a production application, it is recommended that all modules are loaded at boot and kernel module loading is disabled afterwards.h]hXeEven with this in mind, the level of isolation between UML and the host is relatively weak. If the UML userspace is allowed to load arbitrary kernel drivers, an attacker can use this to break out of UML. Thus, if UML is used in a production application, it is recommended that all modules are loaded at boot and kernel module loading is disabled afterwards.}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj.hhubeh}(h]jnah ]h"]security considerationsah$]h&]uh1hhjZ.hhhhhMubeh}(h]jOah ]h"]using uml as a test platformah$]h&]uh1hhj+hhhhhMubeh}(h]jah ]h"]+contributing to uml and developing with umlah$]h&]uh1hhhhhhhhMMubeh}(h] uml-howtoah ]h"] uml howtoah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksj footnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj/error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}creating an image]jasrefids}nameids}(j.j.jjj9 hj j j j/j2 jQj$ jj. jj jjjjcj j[j/jjNjDjpj jjkjjjjjjSjjj<jTj^jjjJ'jj!jju jj!jjU"jHj{"jjjC'jj%jj%jj%jj&jjF&j3jl&jUj&jwj&jj&jj'jj<'jj+j9j )jXj(jwjB(jj|(jj)jj+j j*j*j*jLj*jnj+jj.jje-jj-j jW.j-j.jOj.jnu nametypes}(j.jj9 j j j2 j$ j. j jjcj[jjDj jkjjjSjjTjjJ'j!ju j!jU"j{"jC'j%j%j%j&jF&jl&j&j&j&j'j<'j+j )j(jB(j|(j)j+j*j*j*j+j.je-j-jW.j.j.uh}(j.hjhhjj jj/j jQj jj< jji jj2 jj' j jj/jfjNjjpjjjGjj jjnjjjjj<jVj^jjj^jjjjjjjjx jHj!jjjX"jj~"jjE%jj%jj%jj%j3j&jUjI&jwjo&jj&jj&jj&jj'j9jM'jXj^'jwj}'jj(jjE(jj(j j)j*jd)jLj*jnj*jj+jj+jjm,j jh-j-j-jOjZ.jnj.hhjhj)j jKjBjyjpjjjjjjjjj)j jHj?jjjajjjjjjjjjj j6j-jXjOjj}jjjjjjjj jBj9jdj[jj}jjjjjjj jj-j$jOjFjqjhjjjjjjjjj3j*jRjIjqjhjjjjjjjjj$jjFj=jhj_jjjjjjjjj'jjIj@jhj_u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}j+/K7sRparse_messages]hsystem_message)}(hhh]h)}(hfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.h]hhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj/ubah}(h]h ]h"]h$]h&]levelKtypeINFOlineMsourcehuh1j/hj!hhhhhMubatransform_messages] transformerN include_log] decorationNhhub.