virt-lightning / virt-lightning

Starts your VM on libvirt in a couple of seconds!
184 stars 43 forks source link

wrong resolve.conf values when using new libvirt network #252

Open SulimanLab opened 1 year ago

SulimanLab commented 1 year ago

Hi,

I created new libvirt network using this file:

<network>
  <name>new-network</name>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr011' stp='on' delay='0'/>
  <ip address='192.168.152.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.152.2' end='192.168.152.254'/>
    </dhcp>
  </ip>
</network>

and I added it to virt-lightning file:

- name: tmp
  distro: centos-8
  networks:
    - network: new-network
      ipv4: 192.168.152.12
  memory: 4028
  vcpus: 4 

Then I have noticed that I can't access the internet inside the vm, after some debugging I found that my host ip is not set in /etc/resolv.conf file

; Created by cloud-init on instance boot automatically, do not edit.
;
# Generated by NetworkManager
nameserver 192.168.122.1
nameserver 192.168.123.1

moreover, when I added new-network in ~/.config/virt-lightning/config.ini as default network

[main]
network_name = new-network

it works fine.

goneri commented 1 year ago

It looks like the problem doesn't exist anymore with recent libvirt releases.

goneri commented 1 month ago

Hi @SulimanLab. Do you still gave the problem (I personally don't anymore)? Can I close this?