Why does my networking work while installing os in qemu but doesn't when I boot

1

I have a qemu system running arch-linux. While installing the device with:

qemu-system-x86_64 -hda arch.img -boot d -cdrom archlinux-2014.12.01-dual.iso -m 1024

I can access the network from qemu fine, which I verify by running:

curl www.google.com
# get a google page back

(N.B. as described here ping cannot be used under this default configuration)

Once I have the machine all setup I exit it and then run:

qemu-system-x86_64 -hda arch.img -m 1024

yet the networking does not work this time (again as verified by running curl)

Mike H-R

Posted 2015-01-01T09:44:48.530

Reputation: 662

Answers

0

Turns out I was being an idiot. Just needed to re-enable networking on the qemu device. Interestingly, even though I use a wireless connection for the host machine, I needed to enable the ethernet on the guest machine, as described here.

sudo systemctl start dhcpcd@ens3.service
sudo systemctl enable dhcpcd@ens3.service

note that it is dhcpcd and not dhcpd.

(then verify that it works with curl www.googl.com

Mike H-R

Posted 2015-01-01T09:44:48.530

Reputation: 662

Can you elaborate a bit on this? How is dhcpcd@ens3.service created? I'm assuming that's the interface name for the guest? I'm having issues with booting a windows guest, but it's not clear to me what's going on -- ethernet works, but not wireless. Just stumbled on this and am wondering if there's some virtual interface created for the guest I need to start but I don't see any services in the form listed above. – Hendy – 2016-09-14T15:38:10.860