Jump to content

KVM VM's on Ubuntu Server

I have Ubuntu Server 18.04 LTS with some Samba shares, Nextcloud and other services but i want to create a VM with KVM which I can access it outside LAN.

I have basic KVM knowledge and at the moment I only can create VM and connect via SSH tunneling and this is the problem because I need to connect outside the LAN. I read a few things in Google that I need to create bridge to connect to VM's outside the LAN. I created bridge then I installed Lubuntu and from the VM I have access to the internet also I checked DHCP list from my router and I can see the VM name and the IP but I can't connect with VNC to the VM without SSH tunneling.

Can someone help me to figure out what I am doing wrong?

I can give you whatever logs you want to fix the problem.

Thanks in advance.

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, Milen said:

I have basic KVM knowledge and at the moment i only can create VM and connect via SSH tunneling and this is the problem because i need to connect outside the LAN. I read a few thing in Google that i need to create bridge to connect to VM's outside the LAN. I created bridge then i installed Lubuntu and from the VM i have access to the internet also i checked DHCP list from my router and i can see the VM name and the IP but i cant connect with VNC to the VM without SSH tunneling.

Just to clarify: does the VM have an IP-address similar to the host it's running on? Ie. they are both on the same network?

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
Share on other sites

Link to post
Share on other sites

Yes the server on which is hosted Lubuntu VM is in the same network as the pc from which i am trying to connect to the VM.

 

The output from "ip addr" command:

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: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br0 state UP group default qlen 1000
    link/ether bc:5f:f4:45:8f:0f brd ff:ff:ff:ff:ff:ff
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 36:70:e1:47:e7:49 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.29/24 brd 192.168.1.255 scope global dynamic br0
       valid_lft 86288sec preferred_lft 86288sec
    inet6 fe80::3470:e1ff:fe47:e749/64 scope link
       valid_lft forever preferred_lft forever
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:d5:5c:85 brd ff:ff:ff:ff:ff:ff
    inet 192.168.11.1/24 brd 192.168.11.255 scope global virbr0
       valid_lft forever preferred_lft forever
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:d5:5c:85 brd ff:ff:ff:ff:ff:ff

The output from Netplan network manager config file from Ubuntu server:

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
  version: 2
  renderer: networkd
  ethernets:
    enp5s0:
      dhcp4: true
  bridges:
    br0:
      dhcp4: true
      interfaces:
        - enp5s0

And the output from "brctl show" command:

bridge name     bridge id               STP enabled     interfaces
br0             8000.3670e147e749       no              enp5s0
virbr0          8000.525400d55c85       yes             virbr0-nic

Also output from "virsh net-dhcp-leases default" command:

 Expiry Time          MAC address        Protocol  IP address                Hostname        Client ID or DUID
-------------------------------------------------------------------------------------------------------------------

Lubuntu installation is fresh and i didn't install anything.

Is there a way to access the VM with the ip of the VM from WAN only with any VNC client ?

Link to comment
Share on other sites

Link to post
Share on other sites

Link to comment
Share on other sites

Link to post
Share on other sites

My Ubuntu server is 192.168.1.29, my Lubuntu VM is 192.168.1.7 and my laptop from which im trying to connect to VM is 192.168.1.241.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×