Answer the question
In order to leave comments, you need to log in
How to connect a qemu virtual machine to the main network?
On the workstation - linux, on the guest system - also linux.
I start the virtual machine like this:
emu-system-x86_64 -hda /путь_к_диску.qcow -m 1512 -vga qxl
Answer the question
In order to leave comments, you need to log in
https://www.google.com/search?q=qemu+kvm+bridge+ne...
in short:
1. install the bridge-utils package
2. register the bridge in the network settings on the host, add the network adapter to the bridge; depends on how the network is configured - via netplan or the old fashioned way via /etc/network/interfaces or something else
2.1. now the bridge will be the main network interface on the host, so if there are any iptables rules, etc. not trivial settings, then this should be taken into account
3. create /etc/qemu/bridge.conf and add the line allow bridge_name
In fact, we hand-to-hand configured what is called a virtual switch in Hyper-V or in VMware.
This completes the preparatory steps, it remains to connect the virtual machine to the bridge.
qemu-system-x86_64 -hda /путь_к_диску.qcow -m 1512 -vga qxl -netdev bridge,id=имя_виртуального_адаптера,br=имя_бриджа -device virtio-net-pci,netdev=имя_виртуального_адаптера,mac=52:54:00:12:34:56
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question