Categories
Proxmox

Installing OpenWRT In Proxmox LXC

OpenWRT templates do not come with Proxmox so we are going to have to download them from LXD.

Go to local > CT Template > Download from URL

You can find the OpenWRT LXD Template at

https://us.lxd.images.canonical.com/images/openwrt/

choose the version that you wish to use here we are using an amd64 version of the 21.02 release

find the rootfs.tar.xz file > right click the file > select Copy Link Address

Go back to your web interface and Past this in the box next to URL

Enter File name I will be using OpenWRT.tar.xz

Now go back to the LXD web page and open SHA256SUMS

Copy the sum for rootfs.tar.xz

Go back to your web interface select a Hash algorithm of SHA256

Past the Checksum in the checksum box

Then click Download

Now that we have the OpenWRT template we need to make the CT inside of Proxmox as of right now we can not use the Create CT button in the web interface to do this for the OpenWRT template so we are going to have to use Shell to Open shell for your server from your web interface select your server > click Shell

Now that shell is open we can give Proxmox the command to make the CT below is the command that I used for this you might have to change the CTid number, hostname, or template name for your system

pct create 202 /var/lib/vz/template/cache/OpenWRT.tar.xz --arch amd64 --hostname OpenWrt-21.02 --rootfs local-lvm:202 --memory 1024 --cores 2 --ostype unmanaged --unprivileged 1

This will make a CT but the CT will have no network access so you will have to go back to the web interface and create your network setup.

To do this select your new CT > Network > Add

The first port that we will add will have the Name of eth0

Fill out IPv4/IPv6 as you feel fit this will be your OpenWRT WAN port.

For the second port use the Name of eth1

For this port change Bridge, VLAN Tag, and IPv4/IPv6 as you need to for your needs

Now you can start your OpenWRT CT

now open your web browser and go to the IP address of your OpenWRT CT

Username is root

Password is blank

You might want to tack the time right now to setup a password.

Go to Network > Interfaces

Click Add new Interfaces

Enter a name for this port of eth1 and select eth1 under interfaces. You will need to fill out the other settings as you need for your network setup.

Forum post that help in the making of this project: https://forum.proxmox.com/threads/openwrt-lxc-installation-error.106991/

Categories
Uncategorized

Passing USB Storage Drive to Proxmox LXC

if you are using a container as a storage server, one this that you might want to do is add storage from a USB drive to that container. If you have been looking around you might have found that you can pass a USB port into a container, but after trying to, you found you couldn’t get it working. This blog post is meant to show you how we at VE, pass USB storage to a container that we are using as a storage server.

The first thing that you are going to want to do is mount the USB drive to the server (Proxmox). You can do this in either with the web interface or by command line, if you would like to keep the data on the drive, it is best to use command line.

Command Line

Web Interface

Now that you have the drive mounted, we can start adding the drive to the container. The first thing that we will have to do is take note of the container ID number, and the mount path of the drive. If you used the web interface it can be found by clicking on your server – Disks – Directory

Proxmox screen layout

After you know the path to your disk and the ID number of your CT, it is time to open the shell and set up the mount to the CT.

In my case the drive was mounted at /mnt/pve/USB, and the CT id number was 100.

So I open the CT config file by entering:

$ nano /ect/pve/lxc/[id number].conf

Then I add the following line:

$ mp0: [path to mount],mp=[path to mount in CT]

The path to mount in CT douse can be one you choose.

how the edited config file should look

shoeing working mount

Categories
Proxmox

Installing with Snap Inside of Proxmox Container

If you are going to run snap in a Proxmox container the first thing that you are going to need to have is a container if you already know how to make a container you can skip to the point where we are installing software.

The first step in setting up a container is to get the image that we will use for the container. to do that open the dropdown for your server labeled here as R2D2. Then go down to local and select it, then select CT Templates, after selecting CT Templates, select Templates.

With CT Templates open select the image that you plan on using for this guide I will be using Ubuntu 22.04, after selecting the image click download.

After your image is downloaded it will show up in the CT Templates folder of the local drive.

Enter the hostname for you CT or container, then fill out your root password, finish by clicking Next.

At this screen select the Template that you downloaded.

select the drive that you will store the CT on and set the max size for the CT.

Set the number of CPU cores.

Set the amount of RAM to use for your CT.

Enter the IP address fallowed by the CID sub net mass for most home networks smaller then 254 systems this most likely will be /24. Then enter the address to the gateway on most home networks this will be the ip address for your router.

If your Proxmox server was setup right when installing your should not have to fill out this page, so click Next

If all looks good click Finish.

When the CT is fully setup it will say TASK OK close the window.

Select your new CT under the drop down for your server, then select Options and under Options select Features and click Edit.

A window like this will appear and select FUSE and click OK

To start your CT click Start, then Console to display a command promote.

To log in enter a username of root and the password that was entered in the CT setup.

To update the CT enter the command

apt update && apt upgrade -y

Now with the CT up to date it is time to install the software that we will use to install snap packages to do this use the command

apt install squashfuse snapd -y

Now it is time to install your snap package. to do this you are going to use the command below. This might fail the first time. The package I will install today is called hello

snap install <package name>

This is what it will look like if it fails. The problem is due to apparmor.

Rerun the command and it will complete.