Setup on KVM Hypervisor - Cannot get network connection

Status
Not open for further replies.

Alan9846

Silver Partner
Joined
Aug 24, 2019
Messages
96
Reaction score
19
Hi All,

I am trying to get 3CX installed as a VM on KVM (KVM is running on Ubuntu Server 20.04.2 LTS).

Code:
KVM-Host$ kvm -version

QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.14)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers


Everything *appears* fine with the KVM-Host, but when I boot the 3CX Debian ISO, I run into problems after entering a static IP, and it cannot get an address from the DHCP Server (which is running on my router).

I believe I have all the necessary packages installed on the KVM-Host machine:

Code:
KVM-Host$ sudo apt install --dry-run bridge-utils qemu-kvm libvirt-daemon-system

Reading package lists... Done
Building dependency tree
Reading state information... Done

bridge-utils is already the newest version (1.6-2ubuntu1).
libvirt-daemon-system is already the newest version (6.0.0-0ubuntu8.7).
qemu-kvm is already the newest version (1:4.2-3ubuntu6.14).

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

For the avoidance of doubt, there is no WiFi involved at any point, only ethernet NICs - the KVM-Host machine, my desktop, and the router are all connected to a switch via ethernet cable.

I created a network bridge:

Code:
KVM-Host$ virsh iface-list

Name   State    MAC Address
------------------------------------
br0    active   de:c3:29:25:ea:2f
eno1   active   de:c3:29:25:ea:2f
eno2   active   de:c3:29:25:ea:2f


Code:
KVM-Host$ brctl show

bridge name    bridge id                      STP enabled    interfaces
br0                   8000.dec32925ea2f    no                     bond0
                                                                                     vnet0

I note that both the VM Guest's 'vnet0' interface and the KVM-Host's 'bond0' interface are connected to the br0 bridge - I am inferring that this means that they should be talking to each other?

Code:
KVM-Host$ ip route

default via 172.25.25.254 dev br0 proto static
172.25.25.0/24 dev br0 proto kernel scope link src 172.25.25.3

Code:
KVM-Host$ ip address show

1: lo: <LOOPBACK,UP,LOWER_UP> 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: eno1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
link/ether de:c3:29:25:ea:2f brd ff:ff:ff:ff:ff:ff

3: eno2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
link/ether de:c3:29:25:ea:2f brd ff:ff:ff:ff:ff:ff

4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UP group default qlen 1000
link/ether de:c3:29:25:ea:2f brd ff:ff:ff:ff:ff:ff

5: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether de:c3:29:25:ea:2f brd ff:ff:ff:ff:ff:ff
inet 172.25.25.3/24 brd 172.25.25.255 scope global br0
valid_lft forever preferred_lft forever
inet6 fe80::f0f3:b3ff:fe26:2cc9/64 scope link
valid_lft forever preferred_lft forever

11: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UNKNOWN group default qlen 1000
link/ether fe:54:00:1b:f4:e1 brd ff:ff:ff:ff:ff:ff
inet6 fe80::fc54:ff:fe1b:f4e1/64 scope link
valid_lft forever preferred_lft forever

I note that 'vnet0' is in an 'UNKNOWN' state - not sure if that is the issue, and if so, what I do to address it?

Code:
KVM-Host$ virsh net-dumpxml host-bridge

<network>
    <name>host-bridge</name>
    <uuid>a07efbb0-aa83-435e-a4ad-93b2303cad21</uuid>
    <forward mode='bridge'/>
    <bridge name='br0'/>
</network>

This is the network interface section from the VMGuest machine description in /etc/libvirt/qemu/3CX-Server.xml (I have tried changing the model type from 'virtio' to 'e1000', and 'rtl8139' (all options) - none make any difference.

Code:
<interface type='bridge'>
    <mac address='52:54:00:1b:f4:e1'/>
    <source bridge='br0'/>
    <model type='e1000'/>
    <address type='pci' domain='0x0000' bus='0x09' slot='0x01' function='0x0'/>
</interface>

Code:
KVM-Host$ brctl showmacs br0

port no    mac addr        is local?    ageing timer
1    00:15:62:20:14:41    no           1.46
1    00:21:70:4d:ad:4f    no           0.00
1    00:80:0f:b0:3f:1e    no          72.52
1    00:d9:d1:f5:e9:b0    no           8.98
1    28:80:23:12:e9:16    no           9.85
1    34:31:c4:2f:ac:09    no           0.04
1    52:54:00:1b:f4:e1    no           0.04
1    6c:ad:f8:fd:9b:55    no          30.68
1    84:2b:2b:a1:b2:1a    no           9.34
1    84:2b:2b:a3:5b:42    no          75.13
1    90:f6:52:f8:af:98    no           9.44
1    a8:13:74:72:d4:69    no         129.83
1    d4:53:83:b3:96:0f    no           5.64
1    de:c3:29:25:ea:2f    yes           0.00
1    de:c3:29:25:ea:2f    yes           0.00
1    e8:2a:44:c1:ce:b3    no         208.79
2    fe:54:00:1b:f4:e1    yes           0.00
2    fe:54:00:1b:f4:e1    yes           0.00

The MAC listed above as '52:54:00:1b:f4:e1' is the same as you see in Virt-Manager - 3CX-Server - Info Screen - NIC - MAC Address

Not sure if required, but IPv4 forwarding is enabled:

Code:
KVM-Host$ cat /proc/sys/net/ipv4/ip_forward

1

I have created the VM using this command:

Code:
virt-install --name 3CX-Server --description "3CX-Server" --virt-type kvm --memory 2048 --vcpus 2 --hvm --cpu host --cdrom /media/D_Data/VM/Media/debian-amd64-netinst-3cx --disk path=/media/D_Data/VM/KVM/3CX-Server.qcow2,bus=virtio,size=20,format=qcow2 --noautoconsole --graphics spice --network bridge:br0 --os-variant debian9

The VM appears to be created fine, and I can connect to it from my desktop (Ubuntu Desktop 18.04 LTS) using Virt-Manager.

When I run the VM, it boots up into the 3CX Debian iso install as it would if I did it on bare metal, but when it gets to the DHCP configuration, the VM shows:

Network autoconfiguration failed
Your network is probably not using the DHCP protocol. Alternatively the DHCP server may
be slow or some network hardware is not working properly

I have disabled the KVM-Host firewall to see if that helps, but it made no difference:

Code:
KVM-Host$ sudo ufw status

Status: inactive

There is no issue with DHCP elsewhere in the LAN, and I can communicate between the KVM Server and my Desktop no problem, so there is no general network issue that I can see (other than, possibly, the 'vnet0' item mentioned above).

When I try entering the network config manually (I used 172.25.25.102/24 which is guaranteed not being used, and confirmed via my router), it gets to a 'page' saying:

Detecting link on enp2s1

The next 'stop' is at a screen that says:

[!!] Download debconf preconfiguration file

Failed to retrieve the preconfiguration file

The file needed for preconfiguration could not be retrieved from
http://downloads.3cx.com/downloads/debian9iso/preseed_9.13.0.txt.
The installation will proceed in non-automated mode.
To be sure, I tried and I can download that file fine from my desktop.

If I hit 'continue' It then asks for a hostname and other config as if this were a more standard Debian install.

Whilst I can enter the config manually, it cannot connect to 3CX.com to pull the 'auto configuration' information, and I end up with what appears to be a plain vanilla Debian 9 installation, rather than the 3CX setup screens that we all know and love!

I have done many 3CX installs for clients over the last few years, but all have been on bare metal (mainly NUCs and / or Physical Servers) - this is my first attempt to virtualise.


Any suggestions are welcome.

Thanks,

Alan.
 
Last edited:
Hi Alan,

It appears the main issue is that you can't get Debian to reach the network from your network or KVM environment.

Perhaps some other members can chime in regarding KVM but without getting too much into this, I think this question is more suited for a KVM forum rather than 3CX.
 
Hi John,

It appears the main issue is that you can't get Debian to reach the network from your network or KVM environment.

Perhaps some other members can chime in regarding KVM but without getting too much into this, I think this question is more suited for a KVM forum rather than 3CX.

You are probably right - figured it was worth a try here :-)

I am intending to move all my 3CX clients over to either virtualised setups (like this one) where they want an on-prem server, or 3cx hosted solutions (for those that don't want physical servers) over the coming year or so, as it just seems to make sense (its been at least ten years since we had a WinServer install directly on bare metal I think - even Server 2008R2 were all virtualised so likely longer), and given most of our 3CX installs are on standalone servers, I thought KVM would be a good option.

Maybe someone else here will have a suggestion.

Thanks,

Alan.
 
Status
Not open for further replies.