Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24

Thread: virt-manager NAT networks inactive on system boot

  1. #21
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,296
    Blog Entries
    2

    Default Re: virt-manager NAT networks inactive on system boot

    Pls verify you have a file
    Code:
    /etc/resolv.conf
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  2. #22

    Default Re: virt-manager NAT networks inactive on system boot

    I have this problem as well on Leap 15.1. The problem is that before the virtual network can be started, dnsmasq needs to get DNS info from etc/resolv.conf, which, if you're relying on NetworkManager, will be empty before a connection is made. This will cause dnsmasq to error and the virtual network will not be started. To get around this I added the following line to /usr/lib/systemd/system/libvirtd.service:

    Code:
    [Service]
    ExecStartPre=-/bin/sleep 30
    Just delaying initialization of libvirtd by 30 seconds, which gives network manager enough time to connect beforehand. There's probably another way around this problem, but it was my quick solution.

  3. #23
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,296
    Blog Entries
    2

    Default Re: virt-manager NAT networks inactive on system boot

    Quote Originally Posted by z2 View Post
    I have this problem as well on Leap 15.1. The problem is that before the virtual network can be started, dnsmasq needs to get DNS info from etc/resolv.conf, which, if you're relying on NetworkManager, will be empty before a connection is made. This will cause dnsmasq to error and the virtual network will not be started. To get around this I added the following line to /usr/lib/systemd/system/libvirtd.service:

    Code:
    [Service]
    ExecStartPre=-/bin/sleep 30
    Just delaying initialization of libvirtd by 30 seconds, which gives network manager enough time to connect beforehand. There's probably another way around this problem, but it was my quick solution.
    Although if it works you may not want to change it,
    Instead of a guesstimate you may instead simply "require" that networking be up and running before starting your libvirtd.service, replacing as follows (The following is only after networking is running, you can start after almost anything though)
    Code:
    [Service]
    Requires= network.service
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  4. #24

    Default Re: virt-manager NAT networks inactive on system boot

    Quote Originally Posted by tsu2 View Post
    Although if it works you may not want to change it,
    Instead of a guesstimate you may instead simply "require" that networking be up and running before starting your libvirtd.service, replacing as follows (The following is only after networking is running, you can start after almost anything though)
    Code:
    [Service]
    Requires= network.service
    TSU
    That doesn't work because the network service is active regardless of whether or not NetworkManager has connected to a network. So, the virtual network will still fail to start (I just tried it, to verify). I have KVM installed on a laptop, which is usually connected to wifi. I have to wait a few seconds for the connection to be established before libvirtd starts. The only alternative I can think of is to set static DNS servers, but I didn't want to possibly have to change that if I'm on a different network. Or, I could setup my laptop as a DNS server, but that seems a bit much for just starting a virtual network, and I have no other reason for it to be a DNS server.

    Is it possible to force the virtual network to start without DNS info?

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •