diff options
author | Atanas Bunchev <atanas.bunchev@konsulko.com> | 2022-11-11 12:21:51 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-01 19:20:29 +0000 |
commit | 7ecd9877e6a1b235070d6feba59a3840ebbc5255 (patch) | |
tree | 69f3a037bd983aa973dfc31b7cb1530677a69f57 /documentation | |
parent | a0dcf93bc919757b23a52597eacb1777df4adf24 (diff) | |
download | poky-7ecd9877e6a1b235070d6feba59a3840ebbc5255.tar.gz |
qemu.rst: slirp port forwarding details
Explain the default behavior of `runqemu slirp`.
Explain how to forward ports from the guest to the host machine.
(From yocto-docs rev: 239314da5998f27d0e3a0f2e538216e852bb19d8)
Signed-off-by: Atanas Bunchev <atanas.bunchev@konsulko.com>
Reviewed-by: Quentin Schulz <foss+yocto@0leil.net>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/dev-manual/qemu.rst | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/documentation/dev-manual/qemu.rst b/documentation/dev-manual/qemu.rst index d9b9f69ab3..504fcbdd8d 100644 --- a/documentation/dev-manual/qemu.rst +++ b/documentation/dev-manual/qemu.rst | |||
@@ -329,7 +329,7 @@ Following is the command-line help output for the ``runqemu`` command:: | |||
329 | Simplified QEMU command-line options can be passed with: | 329 | Simplified QEMU command-line options can be passed with: |
330 | nographic - disable video console | 330 | nographic - disable video console |
331 | serial - enable a serial console on /dev/ttyS0 | 331 | serial - enable a serial console on /dev/ttyS0 |
332 | slirp - enable user networking, no root privileges is required | 332 | slirp - enable user networking, no root privileges required |
333 | kvm - enable KVM when running x86/x86_64 (VT-capable CPU required) | 333 | kvm - enable KVM when running x86/x86_64 (VT-capable CPU required) |
334 | kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required) | 334 | kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required) |
335 | publicvnc - enable a VNC server open to all hosts | 335 | publicvnc - enable a VNC server open to all hosts |
@@ -427,6 +427,29 @@ command line: | |||
427 | networking that does not need root access but also is not as easy to | 427 | networking that does not need root access but also is not as easy to |
428 | use or comprehensive as the default. | 428 | use or comprehensive as the default. |
429 | 429 | ||
430 | Using ``slirp`` by default will forward the guest machine's | ||
431 | 22 and 23 TCP ports to host machine's 2222 and 2323 ports | ||
432 | (or the next free ports). Specific forwarding rules can be configured | ||
433 | by setting ``QB_SLIRP_OPT`` as environment variable or in ``qemuboot.conf`` | ||
434 | in the :term:`Build Directory` ``deploy/image`` directory. | ||
435 | Examples:: | ||
436 | |||
437 | QB_SLIRP_OPT="-netdev user,id=net0,hostfwd=tcp::8080-:80" | ||
438 | |||
439 | QB_SLIRP_OPT="-netdev user,id=net0,hostfwd=tcp::8080-:80,hostfwd=tcp::2222-:22" | ||
440 | |||
441 | The first example forwards TCP port 80 from the emulated system to | ||
442 | port 8080 (or the next free port) on the host system, | ||
443 | allowing access to an http server running in QEMU from | ||
444 | ``http://<host ip>:8080/``. | ||
445 | |||
446 | The second example does the same, but also forwards TCP port 22 on the | ||
447 | guest system to 2222 (or the next free port) on the host system, | ||
448 | allowing ssh access to the emulated system using | ||
449 | ``ssh -P 2222 <user>@<host ip>``. | ||
450 | |||
451 | Keep in mind that proper configuration of firewall software is required. | ||
452 | |||
430 | - ``kvm``: Enables KVM when running "qemux86" or "qemux86-64" QEMU | 453 | - ``kvm``: Enables KVM when running "qemux86" or "qemux86-64" QEMU |
431 | architectures. For KVM to work, all the following conditions must be | 454 | architectures. For KVM to work, all the following conditions must be |
432 | met: | 455 | met: |