My goal is to install centos 8 as a virtual machine on ubuntu 18.04 and be able to access the internet on the virtual machine and to access the host file system from the virtual machine. Ideally I would like to have 2 ip addresses, one for the virtual machine and one for the host. The host has wireless connection.
I have successfully installed centos 8 on ubuntu 18.04 as virtual machine with the following command:
sudo virt-install --name=chris_centos --ram=2048 --vcpus=2 --cdrom=/var/lib/libvirt/images/CentOS-8.1.1911-x86_64-dvd1.iso --os-type=linux --os-variant=rhel7 --network bridge=virbr0 --graphics=spice --disk path=/var/lib/libvirt/images/chris_centos.dsk,size=10
The problem however is that I cannot access the internet nor the host file system.
[chh3@localhost ~]$ ping www.google.com
ping: www.google.com: Name or service not known
[chh3@localhost ~]$ ping 8.8.8.8
connect: Network is unreachable
[chh3@localhost ~]$ ping 192.168.1.68
connect: Network is unreachable
I am not sure how get connectivity. Some advice I got on one of the forums is that I cannot use a bridge when it I have a host wireless connection, other said I could. So I am confused. My current net work configuration is:
###### Virtual Machine - chh3 ######
[chh3@localhost ~]$ ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens3: mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 52:54:00:89:6e:34 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.227/24 brd 192.168.122.255 scope global dynamic noprefixroute ens3
valid_lft 3535sec preferred_lft 3535sec
inet6 fe80::15b0:ef7:5811:136d/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: virbr0: mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:e4:b0:0e brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:e4:b0:0e brd ff:ff:ff:ff:ff:ff
###### Host - chh2 ######
chh2@chh2-cpu:~$ ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp2s0: mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether f8:ca:b8:5a:f0:21 brd ff:ff:ff:ff:ff:ff
3: wlp3s0: mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 30:f7:72:10:7f:cb brd ff:ff:ff:ff:ff:ff
inet 192.168.1.68/24 brd 192.168.1.255 scope global dynamic noprefixroute wlp3s0
valid_lft 63744sec preferred_lft 63744sec
inet6 fdc8:cc8:a6bf:5700:7872:90eb:8322:1e95/64 scope global temporary dynamic
valid_lft 7194sec preferred_lft 3594sec
inet6 fdc8:cc8:a6bf:5700:50f2:ecfa:9cd2:6e29/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 7194sec preferred_lft 3594sec
inet6 fe80::3124:b856:7fe9:9386/64 scope link noprefixroute
valid_lft forever preferred_lft forever
4: virbr0: mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 52:54:00:46:0e:83 brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
5: virbr0-nic: mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:46:0e:83 brd ff:ff:ff:ff:ff:ff
11: vnet0: mtu 1500 qdisc fq_codel master virbr0 state UNKNOWN group default qlen 1000
link/ether fe:54:00:89:6e:34 brd ff:ff:ff:ff:ff:ff
inet6 fe80::fc54:ff:fe89:6e34/64 scope link
valid_lft forever preferred_lft forever
Is there a way to configure this or would I need to reinstall in a different way. I am new to this so I appreciate any help I can get.