📄 qemu-doc.texi
字号:
@item @var{interface}:@var{d}TCP connections will only be allowed from @var{interface} on display @var{d}.By convention the TCP port is 5900+@var{d}. Optionally, @var{interface} canbe omitted in which case the server will bind to all interfaces.@item @var{unix}:@var{path}Connections will be allowed over UNIX domain sockets where @var{path} is thelocation of a unix socket to listen for connections on.@item noneVNC is initialized by not started. The monitor @code{change} command can be usedto later start the VNC server.@end tableFollowing the @var{display} value there may be one or more @var{option} flagsseparated by commas. Valid options are@table @code@item passwordRequire that password based authentication is used for client connections.The password must be set separately using the @code{change} command in the@ref{pcsys_monitor}@item tlsRequire that client use TLS when communicating with the VNC server. Thisuses anonymous TLS credentials so is susceptible to a man-in-the-middleattack. It is recommended that this option be combined with either the@var{x509} or @var{x509verify} options.@item x509=@var{/path/to/certificate/dir}Valid if @option{tls} is specified. Require that x509 credentials are usedfor negotiating the TLS session. The server will send its x509 certificateto the client. It is recommended that a password be set on the VNC serverto provide authentication of the client when this is used. The path followingthis option specifies where the x509 certificates are to be loaded from.See the @ref{vnc_security} section for details on generating certificates.@item x509verify=@var{/path/to/certificate/dir}Valid if @option{tls} is specified. Require that x509 credentials are usedfor negotiating the TLS session. The server will send its x509 certificateto the client, and request that the client send its own x509 certificate.The server will validate the client's certificate against the CA certificate,and reject clients when validation fails. If the certificate authority istrusted, this is a sufficient authentication mechanism. You may still wishto set a password on the VNC server as a second authentication layer. Thepath following this option specifies where the x509 certificates are tobe loaded from. See the @ref{vnc_security} section for details on generatingcertificates.@end table@item -k @var{language}Use keyboard layout @var{language} (for example @code{fr} forFrench). This option is only needed where it is not easy to get raw PCkeycodes (e.g. on Macs, with some X11 servers or with a VNCdisplay). You don't normally need to use it on PC/Linux or PC/Windowshosts.The available layouts are:@examplear de-ch es fo fr-ca hu ja mk no pt-br svda en-gb et fr fr-ch is lt nl pl ru thde en-us fi fr-be hr it lv nl-be pt sl tr@end exampleThe default is @code{en-us}.@end tableUSB options:@table @option@item -usbEnable the USB driver (will be the default soon)@item -usbdevice @var{devname}Add the USB device @var{devname}. @xref{usb_devices}.@end tableNetwork options:@table @option@item -net nic[,vlan=@var{n}][,macaddr=@var{addr}][,model=@var{type}]Create a new Network Interface Card and connect it to VLAN @var{n} (@var{n}= 0 is the default). The NIC is an ne2k_pci by default on the PCtarget. Optionally, the MAC address can be changed. If no@option{-net} option is specified, a single NIC is created.Qemu can emulate several different models of network card.Valid values for @var{type} are@code{i82551}, @code{i82557b}, @code{i82559er},@code{ne2k_pci}, @code{ne2k_isa}, @code{pcnet}, @code{rtl8139},@code{smc91c111}, @code{lance} and @code{mcf_fec}.Not all devices are supported on all targets. Use -net nic,model=?for a list of available devices for your target.@item -net user[,vlan=@var{n}][,hostname=@var{name}]Use the user mode network stack which requires no administratorprivilege to run. @option{hostname=name} can be used to specify the clienthostname reported by the builtin DHCP server.@item -net tap[,vlan=@var{n}][,fd=@var{h}][,ifname=@var{name}][,script=@var{file}]Connect the host TAP network interface @var{name} to VLAN @var{n} anduse the network script @var{file} to configure it. The defaultnetwork script is @file{/etc/qemu-ifup}. Use @option{script=no} todisable script execution. If @var{name} is notprovided, the OS automatically provides one. @option{fd}=@var{h} can beused to specify the handle of an already opened host TAP interface. Example:@exampleqemu linux.img -net nic -net tap@end exampleMore complicated example (two NICs, each one connected to a TAP device)@exampleqemu linux.img -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \ -net nic,vlan=1 -net tap,vlan=1,ifname=tap1@end example@item -net socket[,vlan=@var{n}][,fd=@var{h}][,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}]Connect the VLAN @var{n} to a remote VLAN in another QEMU virtualmachine using a TCP socket connection. If @option{listen} isspecified, QEMU waits for incoming connections on @var{port}(@var{host} is optional). @option{connect} is used to connect toanother QEMU instance using the @option{listen} option. @option{fd}=@var{h}specifies an already opened TCP socket.Example:@example# launch a first QEMU instanceqemu linux.img -net nic,macaddr=52:54:00:12:34:56 \ -net socket,listen=:1234# connect the VLAN 0 of this instance to the VLAN 0# of the first instanceqemu linux.img -net nic,macaddr=52:54:00:12:34:57 \ -net socket,connect=127.0.0.1:1234@end example@item -net socket[,vlan=@var{n}][,fd=@var{h}][,mcast=@var{maddr}:@var{port}]Create a VLAN @var{n} shared with another QEMU virtualmachines using a UDP multicast socket, effectively making a bus forevery QEMU with same multicast address @var{maddr} and @var{port}.NOTES:@enumerate@itemSeveral QEMU can be running on different hosts and share same bus (assumingcorrect multicast setup for these hosts).@itemmcast support is compatible with User Mode Linux (argument @option{eth@var{N}=mcast}), see@url{http://user-mode-linux.sf.net}.@itemUse @option{fd=h} to specify an already opened UDP multicast socket.@end enumerateExample:@example# launch one QEMU instanceqemu linux.img -net nic,macaddr=52:54:00:12:34:56 \ -net socket,mcast=230.0.0.1:1234# launch another QEMU instance on same "bus"qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \ -net socket,mcast=230.0.0.1:1234# launch yet another QEMU instance on same "bus"qemu linux.img -net nic,macaddr=52:54:00:12:34:58 \ -net socket,mcast=230.0.0.1:1234@end exampleExample (User Mode Linux compat.):@example# launch QEMU instance (note mcast address selected# is UML's default)qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \ -net socket,mcast=239.192.168.1:1102# launch UML/path/to/linux ubd0=/path/to/root_fs eth0=mcast@end example@item -net noneIndicate that no network devices should be configured. It is used tooverride the default configuration (@option{-net nic -net user}) whichis activated if no @option{-net} options are provided.@item -tftp @var{dir}When using the user mode network stack, activate a built-in TFTPserver. The files in @var{dir} will be exposed as the root of a TFTP server.The TFTP client on the guest must be configured in binary mode (use the command@code{bin} of the Unix TFTP client). The host IP address on the guest is asusual 10.0.2.2.@item -bootp @var{file}When using the user mode network stack, broadcast @var{file} as the BOOTPfilename. In conjunction with @option{-tftp}, this can be used to network boota guest from a local directory.Example (using pxelinux):@exampleqemu -hda linux.img -boot n -tftp /path/to/tftp/files -bootp /pxelinux.0@end example@item -smb @var{dir}When using the user mode network stack, activate a built-in SMBserver so that Windows OSes can access to the host files in @file{@var{dir}}transparently.In the guest Windows OS, the line:@example10.0.2.4 smbserver@end examplemust be added in the file @file{C:\WINDOWS\LMHOSTS} (for windows 9x/Me)or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000).Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}.Note that a SAMBA server must be installed on the host OS in@file{/usr/sbin/smbd}. QEMU was tested successfully with smbd version2.2.7a from the Red Hat 9 and version 3.0.10-1.fc3 from Fedora Core 3.@item -redir [tcp|udp]:@var{host-port}:[@var{guest-host}]:@var{guest-port}When using the user mode network stack, redirect incoming TCP or UDPconnections to the host port @var{host-port} to the guest@var{guest-host} on guest port @var{guest-port}. If @var{guest-host}is not specified, its value is 10.0.2.15 (default address given by thebuilt-in DHCP server).For example, to redirect host X11 connection from screen 1 to guestscreen 0, use the following:@example# on the hostqemu -redir tcp:6001::6000 [...]# this host xterm should open in the guest X11 serverxterm -display :1@end exampleTo redirect telnet connections from host port 5555 to telnet port onthe guest, use the following:@example# on the hostqemu -redir tcp:5555::23 [...]telnet localhost 5555@end exampleThen when you use on the host @code{telnet localhost 5555}, youconnect to the guest telnet server.@end tableLinux boot specific: When using these options, you can use a givenLinux kernel without installing it in the disk image. It can be usefulfor easier testing of various kernels.@table @option@item -kernel @var{bzImage}Use @var{bzImage} as kernel image.@item -append @var{cmdline}Use @var{cmdline} as kernel command line@item -initrd @var{file}Use @var{file} as initial ram disk.@end tableDebug/Expert options:@table @option@item -serial @var{dev}Redirect the virtual serial port to host character device@var{dev}. The default device is @code{vc} in graphical mode and@code{stdio} in non graphical mode.This option can be used several times to simulate up to 4 serialsports.Use @code{-serial none} to disable all serial ports.Available character devices are:@table @code@item vc[:WxH]Virtual console. Optionally, a width and height can be given in pixel with@examplevc:800x600@end exampleIt is also possible to specify width or height in characters:@examplevc:80Cx24C@end example@item pty[Linux only] Pseudo TTY (a new PTY is automatically allocated)@item noneNo device is allocated.@item nullvoid device@item /dev/XXX[Linux only] Use host tty, e.g. @file{/dev/ttyS0}. The host serial portparameters are set according to the emulated ones.@item /dev/parport@var{N}[Linux only, parallel port only] Use host parallel port@var{N}. Currently SPP and EPP parallel port features can be used.@item file:@var{filename}Write output to @var{filename}. No character can be read.@item stdio[Unix only] standard input/output@item pipe:@var{filename}name pipe @var{filename}@item COM@var{n}[Windows only] Use host serial port @var{n}@item udp:[@var{remote_host}]:@var{remote_port}[@@[@var{src_ip}]:@var{src_port}]This implements UDP Net Console.When @var{remote_host} or @var{src_ip} are not specifiedthey default to @code{0.0.0.0}.When not using a specified @var{src_port} a random port is automatically chosen.If you just want a simple readonly console you can use @code{netcat} or@code{nc}, by starting qemu with: @code{-serial udp::4555} and nc as:@code{nc -u -l -p 4555}. Any time qemu writes something to that port itwill appear in the netconsole session.If you plan to send characters back via netconsole or you want to stopand start qemu a lot of times, you should have qemu use the samesource port each time by using something like @code{-serialudp::4555@@:4556} to qemu. Another approach is to use a patchedversion of netcat which can listen to a TCP port and send and receivecharacters via udp. If you have a patched version of netcat whichactivates telnet remote echo and single char transfer, then you canuse the following options to step up a netcat redirector to allowtelnet on port 5555 to access the qemu port.@table @code@item Qemu Options:-serial udp::4555@@:4556@item netcat options:-u -P 4555 -L 0.0.0.0:4556 -t -p 5555 -I -T@item telnet options:localhost 5555@end table@item tcp:[@var{host}]:@var{port}[,@var{server}][,nowait][,nodelay]The TCP Net Console has two modes of operation. It can send the serialI/O to a location or wait for a connection from a location. By defaultthe TCP Net Console is sent to @var{host} at the @var{port}. If you usethe @var{server} option QEMU will wait for a client socket applicationto connect to the port before continuing, unless the @code{nowait}option was specified. The @code{nodelay} option disables the Nagle bufferingalgorithm. If @var{host} is omitted, 0.0.0.0 is assumed. Onlyone TCP connection at a time is accepted. You can use @code{telnet} toconnect to the corresponding character device.@table @code@item Example to send tcp console to 192.168.0.2 port 4444-serial tcp:192.168.0.2:4444@item Example to listen and wait on port 4444 for connection-serial tcp::4444,server@item Example to not wait and listen on ip 192.168.0.100 port 4444-serial tcp:192.168.0.100:4444,server,nowait@end table@item telnet:@var{host}:@var{port}[,server][,nowait][,nodelay]The telnet protocol is used instead of raw tcp sockets. The optionswork the same as if you had specified @code{-serial tcp}. Thedifference is that the port acts like a telnet server or client usingtelnet option negotiation. This will also allow you to send theMAGIC_SYSRQ sequence if you use a telnet that supports sending the breaksequence. Typically in unix telnet you do it with Control-] and thentype "send break" followed by pressing the enter key.@item unix:@var{path}[,server][,nowait]A unix domain socket is used instead of a tcp socket. The option works thesame as if you had specified @code{-serial tcp} except the unix domain socket@var{path} is used for connections.@item mon:@var{dev_string}This is a special option to allow the monitor to be multiplexed ontoanother serial port. The monitor is accessed with key sequence of@key{Control-a} and then pressing @key{c}. See monitor access@ref{pcsys_keys} in the -nographic section for more keys.@var{dev_string} should be any one of the serial devices specifiedabove. An example to multiplex the monitor onto a telnet serverlistening on port 4444 would be:@table @code@item -serial mon:telnet::4444,server,nowait@end table@end table@item -parallel @var{dev}Redirect the virtual parallel port to host device @var{dev} (samedevices as the serial port). On Linux hosts, @file{/dev/parportN} canbe used to use hardware devices connected on the corresponding hostparallel port.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -