📄 qemu.1
字号:
Connect the host \s-1TAP\s0 network interface \fIname\fR to \s-1VLAN\s0 \fIn\fR anduse the network script \fIfile\fR to configure it. The defaultnetwork script is \fI/etc/qemu\-ifup\fR. If \fIname\fR is notprovided, the \s-1OS\s0 automatically provides one. \fBfd=h\fR can beused to specify the handle of an already opened host \s-1TAP\s0 interface. Example:.Sp.Vb 1\& qemu linux.img -net nic -net tap.Ve.SpMore complicated example (two NICs, each one connected to a \s-1TAP\s0 device).Sp.Vb 2\& qemu linux.img -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \e\& -net nic,vlan=1 -net tap,vlan=1,ifname=tap1.Ve.IP "\fB\-net socket[,vlan=n][,fd=h][,listen=[host]:port][,connect=host:port]\fR" 4.IX Item "-net socket[,vlan=n][,fd=h][,listen=[host]:port][,connect=host:port]"Connect the \s-1VLAN\s0 \fIn\fR to a remote \s-1VLAN\s0 in another \s-1QEMU\s0 virtualmachine using a \s-1TCP\s0 socket connection. If \fBlisten\fR isspecified, \s-1QEMU\s0 waits for incoming connections on \fIport\fR(\fIhost\fR is optional). \fBconnect\fR is used to connect toanother \s-1QEMU\s0 instance using the \fBlisten\fR option. \fBfd=h\fRspecifies an already opened \s-1TCP\s0 socket..SpExample:.Sp.Vb 7\& # launch a first QEMU instance\& qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \e\& -net socket,listen=:1234\& # connect the VLAN 0 of this instance to the VLAN 0\& # of the first instance\& qemu linux.img -net nic,macaddr=52:54:00:12:34:57 \e\& -net socket,connect=127.0.0.1:1234.Ve.IP "\fB\-net socket[,vlan=n][,fd=h][,mcast=maddr:port]\fR" 4.IX Item "-net socket[,vlan=n][,fd=h][,mcast=maddr:port]"Create a \s-1VLAN\s0 \fIn\fR shared with another \s-1QEMU\s0 virtualmachines using a \s-1UDP\s0 multicast socket, effectively making a bus for every \s-1QEMU\s0 with same multicast address \fImaddr\fR and \fIport\fR.\&\s-1NOTES:\s0.RS 4.IP "1." 4Several \s-1QEMU\s0 can be running on different hosts and share same bus (assuming correct multicast setup for these hosts)..IP "2." 4mcast support is compatible with User Mode Linux (argument \fBeth\fR\fIN\fR\fB=mcast\fR), see<\fBhttp://user\-mode\-linux.sf.net\fR>..IP "3.<Use \fBfd=h\fR to specify an already opened \s-1UDP\s0 multicast socket.>" 4.IX Item "3.<Use fd=h to specify an already opened UDP multicast socket.>".RE.RS 4.SpExample:.Sp.Vb 9\& # launch one QEMU instance\& qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \e\& -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 \e\& -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 \e\& -net socket,mcast=230.0.0.1:1234.Ve.SpExample (User Mode Linux compat.):.Sp.Vb 6\& # launch QEMU instance (note mcast address selected\& # is UML's default)\& qemu linux.img -net nic,macaddr=52:54:00:12:34:56 \e\& -net socket,mcast=239.192.168.1:1102\& # launch UML\& /path/to/linux ubd0=/path/to/root_fs eth0=mcast.Ve.RE.IP "\fB\-net none\fR" 4.IX Item "-net none"Indicate that no network devices should be configured. It is used tooverride the default configuration (\fB\-net nic \-net user\fR) whichis activated if no \fB\-net\fR options are provided..IP "\fB\-tftp prefix\fR" 4.IX Item "-tftp prefix"When using the user mode network stack, activate a built-in \s-1TFTP\s0server. All filenames beginning with \fIprefix\fR can be downloadedfrom the host to the guest using a \s-1TFTP\s0 client. The \s-1TFTP\s0 client on theguest must be configured in binary mode (use the command \f(CW\*(C`bin\*(C'\fR ofthe Unix \s-1TFTP\s0 client). The host \s-1IP\s0 address on the guest is as usual10.0.2.2..IP "\fB\-smb dir\fR" 4.IX Item "-smb dir"When using the user mode network stack, activate a built-in \s-1SMB\s0server so that Windows OSes can access to the host files in \fIdir\fRtransparently..SpIn the guest Windows \s-1OS\s0, the line:.Sp.Vb 1\& 10.0.2.4 smbserver.Ve.Spmust be added in the file \fIC:\eWINDOWS\eLMHOSTS\fR (for windows 9x/Me)or \fIC:\eWINNT\eSYSTEM32\eDRIVERS\eETC\eLMHOSTS\fR (Windows \s-1NT/2000\s0)..SpThen \fIdir\fR can be accessed in \fI\e\esmbserver\eqemu\fR..SpNote that a \s-1SAMBA\s0 server must be installed on the host \s-1OS\s0 in\&\fI/usr/sbin/smbd\fR. \s-1QEMU\s0 was tested succesfully with smbd version2.2.7a from the Red Hat 9 and version 3.0.10\-1.fc3 from Fedora Core 3..IP "\fB\-redir [tcp|udp]:host\-port:[guest\-host]:guest\-port\fR" 4.IX Item "-redir [tcp|udp]:host-port:[guest-host]:guest-port"When using the user mode network stack, redirect incoming \s-1TCP\s0 or \s-1UDP\s0connections to the host port \fIhost-port\fR to the guest\&\fIguest-host\fR on guest port \fIguest-port\fR. If \fIguest-host\fRis not specified, its value is 10.0.2.15 (default address given by thebuilt-in \s-1DHCP\s0 server)..SpFor example, to redirect host X11 connection from screen 1 to guestscreen 0, use the following:.Sp.Vb 4\& # on the host\& qemu -redir tcp:6001::6000 [...]\& # this host xterm should open in the guest X11 server\& xterm -display :1.Ve.SpTo redirect telnet connections from host port 5555 to telnet port onthe guest, use the following:.Sp.Vb 3\& # on the host\& qemu -redir tcp:5555::23 [...]\& telnet localhost 5555.Ve.SpThen when you use on the host \f(CW\*(C`telnet localhost 5555\*(C'\fR, youconnect to the guest telnet server..PPLinux 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..IP "\fB\-kernel bzImage\fR" 4.IX Item "-kernel bzImage"Use \fIbzImage\fR as kernel image..IP "\fB\-append cmdline\fR" 4.IX Item "-append cmdline"Use \fIcmdline\fR as kernel command line.IP "\fB\-initrd file\fR" 4.IX Item "-initrd file"Use \fIfile\fR as initial ram disk..PPDebug/Expert options:.IP "\fB\-serial dev\fR" 4.IX Item "-serial dev"Redirect the virtual serial port to host device \fIdev\fR. Availabledevices are:.RS 4.ie n .IP """vc""" 4.el .IP "\f(CWvc\fR" 4.IX Item "vc"Virtual console.ie n .IP """pty""" 4.el .IP "\f(CWpty\fR" 4.IX Item "pty"[Linux only] Pseudo \s-1TTY\s0 (a new \s-1PTY\s0 is automatically allocated).ie n .IP """null""" 4.el .IP "\f(CWnull\fR" 4.IX Item "null"void device.ie n .IP """/dev/XXX""" 4.el .IP "\f(CW/dev/XXX\fR" 4.IX Item "/dev/XXX"[Linux only] Use host tty, e.g. \fI/dev/ttyS0\fR. The host serial portparameters are set according to the emulated ones..ie n .IP """/dev/parportN""" 4.el .IP "\f(CW/dev/parportN\fR" 4.IX Item "/dev/parportN"[Linux only, parallel port only] Use host parallel port\&\fIN\fR. Currently only \s-1SPP\s0 parallel port features can be used..ie n .IP """file:filename""" 4.el .IP "\f(CWfile:filename\fR" 4.IX Item "file:filename"Write output to filename. No character can be read..ie n .IP """stdio""" 4.el .IP "\f(CWstdio\fR" 4.IX Item "stdio"[Unix only] standard input/output.ie n .IP """pipe:filename""" 4.el .IP "\f(CWpipe:filename\fR" 4.IX Item "pipe:filename"[Unix only] name pipe \fIfilename\fR.RE.RS 4.SpThe default device is \f(CW\*(C`vc\*(C'\fR in graphical mode and \f(CW\*(C`stdio\*(C'\fR innon graphical mode..SpThis option can be used several times to simulate up to 4 serialsports..RE.IP "\fB\-parallel dev\fR" 4.IX Item "-parallel dev"Redirect the virtual parallel port to host device \fIdev\fR (samedevices as the serial port). On Linux hosts, \fI/dev/parportN\fR canbe used to use hardware devices connected on the corresponding hostparallel port..SpThis option can be used several times to simulate up to 3 parallelports..IP "\fB\-monitor dev\fR" 4.IX Item "-monitor dev"Redirect the monitor to host device \fIdev\fR (same devices as theserial port).The default device is \f(CW\*(C`vc\*(C'\fR in graphical mode and \f(CW\*(C`stdio\*(C'\fR innon graphical mode..IP "\fB\-s\fR" 4.IX Item "-s"Wait gdb connection to port 1234. .IP "\fB\-p port\fR" 4.IX Item "-p port"Change gdb connection port..IP "\fB\-S\fR" 4.IX Item "-S"Do not start \s-1CPU\s0 at startup (you must type 'c' in the monitor)..IP "\fB\-d\fR" 4.IX Item "-d"Output log in /tmp/qemu.log.IP "\fB\-hdachs c,h,s,[,t]\fR" 4.IX Item "-hdachs c,h,s,[,t]"Force hard disk 0 physical geometry (1 <= \fIc\fR <= 16383, 1 <=\&\fIh\fR <= 16, 1 <= \fIs\fR <= 63) and optionally force the \s-1BIOS\s0translation mode (\fIt\fR=none, lba or auto). Usually \s-1QEMU\s0 can guessall thoses parameters. This option is useful for old MS-DOS diskimages..IP "\fB\-std\-vga\fR" 4.IX Item "-std-vga"Simulate a standard \s-1VGA\s0 card with Bochs \s-1VBE\s0 extensions (default isCirrus Logic \s-1GD5446\s0 \s-1PCI\s0 \s-1VGA\s0).IP "\fB\-loadvm file\fR" 4.IX Item "-loadvm file"Start right away with a saved state (\f(CW\*(C`loadvm\*(C'\fR in monitor).PPDuring the graphical emulation, you can use the following keys:.IP "\fBCtrl-Alt-f\fR" 4.IX Item "Ctrl-Alt-f"Toggle full screen.IP "\fBCtrl-Alt-n\fR" 4.IX Item "Ctrl-Alt-n"Switch to virtual console 'n'. Standard console mappings are:.RS 4.IP "\fI1\fR" 4.IX Item "1"Target system display.IP "\fI2\fR" 4.IX Item "2"Monitor.IP "\fI3\fR" 4.IX Item "3"Serial port.RE.RS 4.RE.IP "\fBCtrl-Alt\fR" 4.IX Item "Ctrl-Alt"Toggle mouse and keyboard grab..PPIn the virtual consoles, you can use \fBCtrl-Up\fR, \fBCtrl-Down\fR,\&\fBCtrl-PageUp\fR and \fBCtrl-PageDown\fR to move in the back log..PPDuring emulation, if you are using the \fB\-nographic\fR option, use\&\fBCtrl-a h\fR to get terminal commands:.IP "\fBCtrl-a h\fR" 4.IX Item "Ctrl-a h"Print this help.IP "\fBCtrl-a x\fR" 4.IX Item "Ctrl-a x"Exit emulatior.IP "\fBCtrl-a s\fR" 4.IX Item "Ctrl-a s"Save disk data back to file (if \-snapshot).IP "\fBCtrl-a b\fR" 4.IX Item "Ctrl-a b"Send break (magic sysrq in Linux).IP "\fBCtrl-a c\fR" 4.IX Item "Ctrl-a c"Switch between console and monitor.IP "\fBCtrl-a Ctrl-a\fR" 4.IX Item "Ctrl-a Ctrl-a"Send Ctrl-a.PPThe following options are specific to the PowerPC emulation:.IP "\fB\-g WxH[xDEPTH]\fR" 4.IX Item "-g WxH[xDEPTH]"Set the initial \s-1VGA\s0 graphic mode. The default is 800x600x15..PPThe following options are specific to the Sparc emulation:.IP "\fB\-g WxH\fR" 4.IX Item "-g WxH"Set the initial \s-1TCX\s0 graphic mode. The default is 1024x768..SH "SEE ALSO".IX Header "SEE ALSO"The \s-1HTML\s0 documentation of \s-1QEMU\s0 for more precise information and Linuxuser mode emulator invocation..SH "AUTHOR".IX Header "AUTHOR"Fabrice Bellard
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -