Update all qemu article to add host port forwarding

This commit is contained in:
Julien Dessaux 2022-08-30 16:14:08 +02:00
parent f8329249d1
commit de7791d148
Signed by: adyxax
GPG key ID: F92E51B86E07177E

View file

@ -19,10 +19,10 @@ qemu-system-x86_64 -drive file=alpine.raw,format=raw,cache=writeback \
-cdrom Downloads/alpine-virt-3.14.0-x86_64.iso \ -cdrom Downloads/alpine-virt-3.14.0-x86_64.iso \
-boot d -machine type=q35,accel=kvm \ -boot d -machine type=q35,accel=kvm \
-cpu host -smp 2 -m 1024 -vnc :0 \ -cpu host -smp 2 -m 1024 -vnc :0 \
-device virtio-net,netdev=vmnic -netdev user,id=vmnic -device virtio-net,netdev=vmnic -netdev user,id=vmnic,hostfwd=tcp::10022-:22
``` ```
Connect to the console with a `vncviewer :0`. Connect to the console with a `vncviewer :0`, or if an ssh server is running, use `ssh -p10022 root@localhost`.
## Afterwards ## Afterwards
@ -30,7 +30,7 @@ Connect to the console with a `vncviewer :0`.
qemu-system-x86_64 -drive file=alpine.raw,format=raw,cache=writeback \ qemu-system-x86_64 -drive file=alpine.raw,format=raw,cache=writeback \
-boot c -machine type=q35,accel=kvm \ -boot c -machine type=q35,accel=kvm \
-cpu host -smp 2 -m 1024 -vnc :0 \ -cpu host -smp 2 -m 1024 -vnc :0 \
-device virtio-net,netdev=vmnic -netdev user,id=vmnic -device virtio-net,netdev=vmnic -netdev user,id=vmnic,hostfwd=tcp::10022-:22
``` ```
## References ## References