⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qemu-doc.texi

📁 QEMU 0.91 source code, supports ARM processor including S3C24xx series
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
@end exampleThis ensures that only users on local box with read/write access to thatpath can access the VNC server. To securely access the VNC server from aremote machine, a combination of netcat+ssh can be used to provide a securetunnel.@node vnc_sec_password@subsection With passwordsThe VNC protocol has limited support for password based authentication. Sincethe protocol limits passwords to 8 characters it should not be consideredto provide high security. The password can be fairly easily brute-forced bya client making repeat connections. For this reason, a VNC server using passwordauthentication should be restricted to only listen on the loopback interfaceor UNIX domain sockets. Password ayuthentication is requested with the @code{password}option, and then once QEMU is running the password is set with the monitor. Untilthe monitor is used to set the password all clients will be rejected.@exampleqemu [...OPTIONS...] -vnc :1,password -monitor stdio(qemu) change vnc passwordPassword: ********(qemu)@end example@node vnc_sec_certificate@subsection With x509 certificatesThe QEMU VNC server also implements the VeNCrypt extension allowing use ofTLS for encryption of the session, and x509 certificates for authentication.The use of x509 certificates is strongly recommended, because TLS on itsown is susceptible to man-in-the-middle attacks. Basic x509 certificatesupport provides a secure session, but no authentication. This allows anyclient to connect, and provides an encrypted session.@exampleqemu [...OPTIONS...] -vnc :1,tls,x509=/etc/pki/qemu -monitor stdio@end exampleIn the above example @code{/etc/pki/qemu} should contain at least three files,@code{ca-cert.pem}, @code{server-cert.pem} and @code{server-key.pem}. Unprivilegedusers will want to use a private directory, for example @code{$HOME/.pki/qemu}.NB the @code{server-key.pem} file should be protected with file mode 0600 toonly be readable by the user owning it.@node vnc_sec_certificate_verify@subsection With x509 certificates and client verificationCertificates can also provide a means to authenticate the client connecting.The server will request that the client provide a certificate, which it willthen validate against the CA certificate. This is a good choice if deployingin an environment with a private internal certificate authority.@exampleqemu [...OPTIONS...] -vnc :1,tls,x509verify=/etc/pki/qemu -monitor stdio@end example@node vnc_sec_certificate_pw@subsection With x509 certificates, client verification and passwordsFinally, the previous method can be combined with VNC password authenticationto provide two layers of authentication for clients.@exampleqemu [...OPTIONS...] -vnc :1,password,tls,x509verify=/etc/pki/qemu -monitor stdio(qemu) change vnc passwordPassword: ********(qemu)@end example@node vnc_generate_cert@subsection Generating certificates for VNCThe GNU TLS packages provides a command called @code{certtool} which canbe used to generate certificates and keys in PEM format. At a minimum itis neccessary to setup a certificate authority, and issue certificates toeach server. If using certificates for authentication, then each clientwill also need to be issued a certificate. The recommendation is for theserver to keep its certificates in either @code{/etc/pki/qemu} or forunprivileged users in @code{$HOME/.pki/qemu}.@menu* vnc_generate_ca::* vnc_generate_server::* vnc_generate_client::@end menu@node vnc_generate_ca@subsubsection Setup the Certificate AuthorityThis step only needs to be performed once per organization / organizationalunit. First the CA needs a private key. This key must be kept VERY secretand secure. If this key is compromised the entire trust chain of the certificatesissued with it is lost.@example# certtool --generate-privkey > ca-key.pem@end exampleA CA needs to have a public certificate. For simplicity it can be a self-signedcertificate, or one issue by a commercial certificate issuing authority. Togenerate a self-signed certificate requires one core piece of information, thename of the organization.@example# cat > ca.info <<EOFcn = Name of your organizationcacert_signing_keyEOF# certtool --generate-self-signed \           --load-privkey ca-key.pem           --template ca.info \           --outfile ca-cert.pem@end exampleThe @code{ca-cert.pem} file should be copied to all servers and clients wishing to utilizeTLS support in the VNC server. The @code{ca-key.pem} must not be disclosed/copied at all.@node vnc_generate_server@subsubsection Issuing server certificatesEach server (or host) needs to be issued with a key and certificate. When connectingthe certificate is sent to the client which validates it against the CA certificate.The core piece of information for a server certificate is the hostname. This shouldbe the fully qualified hostname that the client will connect with, since the clientwill typically also verify the hostname in the certificate. On the host holding thesecure CA private key:@example# cat > server.info <<EOForganization = Name  of your organizationcn = server.foo.example.comtls_www_serverencryption_keysigning_keyEOF# certtool --generate-privkey > server-key.pem# certtool --generate-certificate \           --load-ca-certificate ca-cert.pem \           --load-ca-privkey ca-key.pem \           --load-privkey server server-key.pem \           --template server.info \           --outfile server-cert.pem@end exampleThe @code{server-key.pem} and @code{server-cert.pem} files should now be securely copiedto the server for which they were generated. The @code{server-key.pem} is securitysensitive and should be kept protected with file mode 0600 to prevent disclosure.@node vnc_generate_client@subsubsection Issuing client certificatesIf the QEMU VNC server is to use the @code{x509verify} option to validate clientcertificates as its authentication mechanism, each client also needs to be issueda certificate. The client certificate contains enough metadata to uniquely identifythe client, typically organization, state, city, building, etc. On the host holdingthe secure CA private key:@example# cat > client.info <<EOFcountry = GBstate = Londonlocality = Londonorganiazation = Name of your organizationcn = client.foo.example.comtls_www_clientencryption_keysigning_keyEOF# certtool --generate-privkey > client-key.pem# certtool --generate-certificate \           --load-ca-certificate ca-cert.pem \           --load-ca-privkey ca-key.pem \           --load-privkey client-key.pem \           --template client.info \           --outfile client-cert.pem@end exampleThe @code{client-key.pem} and @code{client-cert.pem} files should now be securelycopied to the client for which they were generated.@node gdb_usage@section GDB usageQEMU has a primitive support to work with gdb, so that you can do'Ctrl-C' while the virtual machine is running and inspect its state.In order to use gdb, launch qemu with the '-s' option. It will wait for agdb connection:@example> qemu -s -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \       -append "root=/dev/hda"Connected to host network interface: tun0Waiting gdb connection on port 1234@end exampleThen launch gdb on the 'vmlinux' executable:@example> gdb vmlinux@end exampleIn gdb, connect to QEMU:@example(gdb) target remote localhost:1234@end exampleThen you can use gdb normally. For example, type 'c' to launch the kernel:@example(gdb) c@end exampleHere are some useful tips in order to use gdb on system code:@enumerate@itemUse @code{info reg} to display all the CPU registers.@itemUse @code{x/10i $eip} to display the code at the PC position.@itemUse @code{set architecture i8086} to dump 16 bit code. Then use@code{x/10i $cs*16+$eip} to dump the code at the PC position.@end enumerate@node pcsys_os_specific@section Target OS specific information@subsection LinuxTo have access to SVGA graphic modes under X11, use the @code{vesa} orthe @code{cirrus} X11 driver. For optimal performances, use 16 bitcolor depth in the guest and the host OS.When using a 2.6 guest Linux kernel, you should add the option@code{clock=pit} on the kernel command line because the 2.6 Linuxkernels make very strict real time clock checks by default that QEMUcannot simulate exactly.When using a 2.6 guest Linux kernel, verify that the 4G/4G patch isnot activated because QEMU is slower with this patch. The QEMUAccelerator Module is also much slower in this case. Earlier FedoraCore 3 Linux kernel (< 2.6.9-1.724_FC3) were known to incorporate thispatch by default. Newer kernels don't have it.@subsection WindowsIf you have a slow host, using Windows 95 is better as it gives thebest speed. Windows 2000 is also a good choice.@subsubsection SVGA graphic modes supportQEMU emulates a Cirrus Logic GD5446 Videocard. All Windows versions starting from Windows 95 should recognizeand use this graphic card. For optimal performances, use 16 bit colordepth in the guest and the host OS.If you are using Windows XP as guest OS and if you want to use highresolution modes which the Cirrus Logic BIOS does not support (i.e. >=1280x1024x16), then you should use the VESA VBE virtual graphic card(option @option{-std-vga}).@subsubsection CPU usage reductionWindows 9x does not correctly use the CPU HLTinstruction. The result is that it takes host CPU cycles even whenidle. You can install the utility from@url{http://www.user.cityline.ru/~maxamn/amnhltm.zip} to solve thisproblem. Note that no such tool is needed for NT, 2000 or XP.@subsubsection Windows 2000 disk full problemWindows 2000 has a bug which gives a disk full problem during itsinstallation. When installing it, use the @option{-win2k-hack} QEMUoption to enable a specific workaround. After Windows 2000 isinstalled, you no longer need this option (this option slows down theIDE transfers).@subsubsection Windows 2000 shutdownWindows 2000 cannot automatically shutdown in QEMU although Windows 98can. It comes from the fact that Windows 2000 does not automaticallyuse the APM driver provided by the BIOS.In order to correct that, do the following (thanks to StruanBartlett): go to the Control Panel => Add/Remove Hardware & Next =>Add/Troubleshoot a device => Add a new device & Next => No, select thehardware from a list & Next => NT Apm/Legacy Support & Next => Next(again) a few times. Now the driver is installed and Windows 2000 nowcorrectly instructs QEMU to shutdown at the appropriate moment.@subsubsection Share a directory between Unix and WindowsSee @ref{sec_invocation} about the help of the option @option{-smb}.@subsubsection Windows XP security problemSome releases of Windows XP install correctly but give a securityerror when booting:@exampleA problem is preventing Windows from accurately checking thelicense for this computer. Error code: 0x800703e6.@end exampleThe workaround is to install a service pack for XP after a boot in safemode. Then reboot, and the problem should go away. Since there is nonetwork while in safe mode, its recommended to download the fullinstallation of SP1 or SP2 and transfer that via an ISO or using thevvfat block device ("-hdb fat:directory_which_holds_the_SP").@subsection MS-DOS and FreeDOS@subsubsection CPU usage reductionDOS does not correctly use the CPU HLT instruction. The result is thatit takes host CPU cycles even when idle. You can install the utilityfrom @url{http://www.vmware.com/software/dosidle210.zip} to solve thisproblem.@node QEMU System emulator for non PC targets@chapter QEMU System emulator for non PC targetsQEMU is a generic emulator and it emulates many non PCmachines. Most of the options are similar to the PC emulator. Thedifferences are mentioned in the following sections.@menu* QEMU PowerPC System emulator::* Sparc32 System emulator::* Sparc64 System emulator::* MIPS System emulator::* ARM System emulator::* ColdFire System emulator::@end menu@node QEMU PowerPC System emulator@section QEMU PowerPC System emulatorUse the executable @file{qemu-system-ppc} to simulate a complete PREPor PowerMac PowerPC system.QEMU emulates the following PowerMac peripherals:@itemize @minus@itemUniNorth PCI Bridge@itemPCI VGA compatible card with VESA Bochs Extensions@item2 PMAC IDE interfaces with hard disk and CD-ROM support@itemNE2000 PCI adapters@itemNon Volatile RAM@itemVIA-CUDA with ADB keyboard and mouse.@end itemizeQEMU emulates the following PREP peripherals:@itemize @minus@itemPCI Bridge@itemPCI VGA compatible card with VESA Bochs Extensions@item2 IDE interfaces with hard disk and CD-ROM support@itemFloppy disk@itemNE2000 network adapters@itemSerial port@itemPREP Non Volatile RAM@itemPC compatible keyboard and mouse.@end itemizeQEMU uses the Open Hack'Ware Open Firmware Compatible BIOS available at@url{http://perso.magic.fr/l_indien/OpenHackWare/index.htm}.@c man begin OPTIONSThe following options are specific to the PowerPC emulation:@table @option@item -g WxH[xDEPTH]Set the initial VGA graphic mode. The default is 800x600x15.@end table@c man endMore information is available at@url{http://perso.magic.fr/l_indien/qemu-ppc/}.@node Sparc32 System emulator@secti

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -