Home How to create a container (LXE) template running Ubuntu 20.04
Post
Cancel

How to create a container (LXE) template running Ubuntu 20.04

Upgrade the system packages.

1
sudo apt update && sudo apt dist-upgrade

Clean up the container (optional)

1
sudo apt clean && sudo apt autoremove

Add a new user.

1
adduser {your username}

Configure SSH.

Change to /etc/ssh directory.

1
cd /etc/ssh

Clear out the host keys (make sur eyou stay logged in).

1
sudo rm ssh_host_*

Make the machine ID unique. First check that it exists (it will show up as a string of characters).

1
cat /ect/machine-id

Clear it out.

1
sudo truncate -s 0 /etc/machine-id

Shut down the container.

1
sudo powerdown

In Proxmox, right click on container and convert container to a template.

Start it up and use the console to login and run the following command.

1
sudo dpkg-reconfigure openssh-server

Then, in a terminal, try to ssh into the container.

1
ssh {your_username}@{your_ip}


You can get the IP of your container from the console in Proxmox by running:

1
ip a
This post is licensed under CC BY 4.0 by the author.