On 07/12/2018 10:26 PM, Dick Steffens wrote:
> While I've got Win7 up and running, the network setting are screwy. I
> have my router set to be a DHCP server, with 192.168.0.1 as the default
> gateway. I also assigned 192.168.0.104 as a static lease for the virtual
> machine. However, the IPv4 address and default gateway are
> 192.168.122.153 and 192.168.122.1.
> 
> I think I've discovered that QEMU provides a DHCP server. What I haven't
> found is how to tell QEMU not to be a DHCP server but to use my router.
> Any clues as to where to make that change will be gratefully received.
> 
Yes, qemu by default runs its own internal DHCP and NAT to isolate the
VM from the host while providing internet access. This is on purpose for
best security.  If you just need to share files between host and VM,
best to just use the builtin SAMBA:

-netdev user,id=mynet1,hostname=win7vm,smb=/games/win32/
-device virtio-net-pci,netdev=mynet1,mac=52:54:00:35:a6:50

where '/games/win32/' is a path on the host. Access that directory
within the VM via:

\\10.0.2.4\qemu

for the default network config above.  You can add a few options so that
all VMs on the host can see each another and still be isolated from the
host (all static IP or one of the VMs also runs a DHCP server).

To have the VM as part of your network. make sure that
'qemu-bridge-helper' is installed, then use something like:

-net nic -net tap,ifname=tap0,script=no,downscript=no

or

-device virtio-net,netdev=network0
-netdev tap,id=network0,ifname=tap0,script=no,downscript=no[,vhost=on]

References
-----------
https://en.wikibooks.org/wiki/QEMU/Networking
https://www.linux-kvm.org/page/Networking
https://wiki.qemu.org/Documentation/Networking
https://wiki.archlinux.org/index.php/QEMU#Networking

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
PLUG mailing list
PLUG@pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to