2 Format code
source | link

I want to run a virtual machine using QEMU and KVM on my Arch Linux host with a configuration such that I can ssh into the guest OS from my host, but I want to prevent the guest OS from being able to communicate with the internet. Currently, I use the following command line to invoke qemu:

qemu-system-x86_64 -enable-kvm -net user,hostfwd=tcp::8022-:22 -net nic,model=virtio -m 1G,slots=2,maxmem=3G -cpu host -M 1.6 -machine type=pc,accel=kvm -boot order=c -drive file="image.img",format=raw,aio=native,cache=none;

How should I configure qemu / host OS to prevent the guest from accessing the internet without limiting my ability to ssh into the guest to share files?

I want to run a virtual machine using QEMU and KVM on my Arch Linux host with a configuration such that I can ssh into the guest OS from my host, but I want to prevent the guest OS from being able to communicate with the internet. Currently, I use the following command line to invoke qemu:

qemu-system-x86_64 -enable-kvm -net user,hostfwd=tcp::8022-:22 -net nic,model=virtio -m 1G,slots=2,maxmem=3G -cpu host -M 1.6 -machine type=pc,accel=kvm -boot order=c -drive file="image.img",format=raw,aio=native,cache=none;

How should I configure qemu / host OS to prevent the guest from accessing the internet without limiting my ability to ssh into the guest to share files?

I want to run a virtual machine using QEMU and KVM on my Arch Linux host with a configuration such that I can ssh into the guest OS from my host, but I want to prevent the guest OS from being able to communicate with the internet. Currently, I use the following command line to invoke qemu:

qemu-system-x86_64 -enable-kvm -net user,hostfwd=tcp::8022-:22 -net nic,model=virtio -m 1G,slots=2,maxmem=3G -cpu host -M 1.6 -machine type=pc,accel=kvm -boot order=c -drive file="image.img",format=raw,aio=native,cache=none;

How should I configure qemu / host OS to prevent the guest from accessing the internet without limiting my ability to ssh into the guest to share files?

1
source | link

Allow host to ssh into QEMU guest but disable all other networking

I want to run a virtual machine using QEMU and KVM on my Arch Linux host with a configuration such that I can ssh into the guest OS from my host, but I want to prevent the guest OS from being able to communicate with the internet. Currently, I use the following command line to invoke qemu:

qemu-system-x86_64 -enable-kvm -net user,hostfwd=tcp::8022-:22 -net nic,model=virtio -m 1G,slots=2,maxmem=3G -cpu host -M 1.6 -machine type=pc,accel=kvm -boot order=c -drive file="image.img",format=raw,aio=native,cache=none;

How should I configure qemu / host OS to prevent the guest from accessing the internet without limiting my ability to ssh into the guest to share files?