Issue
I'm just trying to get access to the internet from my centos-7 guest. Host: Ubuntu 18.04
I read some basic guides and run qemu with:
sudo qemu-system-x86_64 -enable-kvm -drive file=centos7-disk.qcow2,index=0,media=disk -drive file=centos7-disk.raw,index=1,media=disk,format=raw -m 1024 -cpu host -netdev user,id=n1 -device virtio-net,netdev=n1 -serial stdio
In the guest i get an eth0 interface with an ip 172.20.189.16/16. But when i try something like
curl www.google.com
i get stuck and then:
curl: (6) Could not resolve host: www.google.com; Unknown error
I've also tried to run it with -device e1000,netdev=n1 instead of -device virtio-net,netdev=n1. In this case i don't even get the eth0 interface and curl fails immediately with the same error.
*The guest runs on 3.10.0-1160.el7 kernel with no changes in config.
Solution
I found an answer here.
The point is that i have centos-7 minimal that requires some network settings being up manually. For the workaround i needed just run dhclient manually:
dhclient ens3
ens3 - virtual NIC in case of mine.
To make the change permanent i did:
nmcli con mod ens3 connection.autoconnect yes
Answered By - Rost
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.