Skip to content

Instantly share code, notes, and snippets.

@bferg314
Last active January 25, 2020 01:26
Show Gist options
  • Save bferg314/668719aeadfb41f072c5115f3df494ee to your computer and use it in GitHub Desktop.
Save bferg314/668719aeadfb41f072c5115f3df494ee to your computer and use it in GitHub Desktop.
Adventures in creating some VMs on a headless 18.04 Ubuntu Server

Hardware

Dell Optiplex 7010 USFF I got on NewEgg for about $110
8GB ram and an i5
Needed a display port emulator to convince the BIOS there is a monitor attached. Another $8.

Ubuntu

Grabbed the latest 18.04 LTS. Installed it using the normal installation routine.
Configured SSH right out of the gate.

Configuration

So, everything is set up and I stashed the device in the basment. Next step, ssh into the device. I found the IP using my router, but any old network scan should track dopwn the IP of your device.

Configure the Network

ifconfig to get your adapter name, then configure your network adapter with netplan.

Crack open your netplan config

sudo vim /etc/netplan/50-cloud-init.yaml

Here is a normal adapter...

network:
  version: 2
  ethernets:
    eno1:
      addresses: [192.168.1.2/24]
      gateway4: 192.168.1.1
      nameservers:
        addresses: [192.168.1.1, 1.1.1.1, 1.0.0.1]
      optional: true

And a bridged adapter for running VMs

network:
  version: 2
  ethernets:
    eno1:
      dhcp4: no
      dhcp6: no

  bridges:
    br0:
      interfaces: [eno1]
      dhcp4: no
      addresses: [192.168.1.2/24]
      gateway4: 192.168.1.1
      nameservers:
        addresses: [192.168.1.1]

Apply your changes... Try first of course.

sudo netplan try
sudo netplan apply

Couple links to use...
https://www.linuxtechi.com/install-configure-kvm-ubuntu-18-04-server/
https://www.ostechnix.com/setup-headless-virtualization-server-using-kvm-ubuntu/
https://computingforgeeks.com/virsh-commands-cheatsheet/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment