Skip to content

LXC Install and Container

Install LXC on host

Install LXC container environment.

apt-get install lxc

Show possible lxc container OS'es

ls -la /usr/share/lxc/templates/

Create an LXC container.

Container type from selection out of list (ubuntu,jammy,amd64).

lxc-create -n <container-name> -t download

Start the container.

lxc-start -n <container-name>

Enter console on the container as root.

lxc-attach -n <container-name>

Container Configuration

apt install joe wget gpg

Installing Jenkins (root)

Following the website Digital Ocean and Jenkins.io a bit.

Add the repository key for apt package manager:

wget -O  "/usr/share/keyrings/jenkins-keyring.asc" - "https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key" 

Append the package repository address to the server’s sources.list:

echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] http://pkg.jenkins.io/debian-stable binary/" > /etc/apt/sources.list.d/jenkins.list

Update the local package index and install Jenkins:

apt update
apt install fontconfig default-jre jenkins

Configure Jenkins

Open Jenkins web-application at http://<lxc-guest-ip>:8080.

Initial password is found in /var/lib/jenkins/secrets/initialAdminPassword.

cat /var/lib/jenkins/secrets/initialAdminPassword

For job configuration see Jekins website.

Force English Language

By default, Jenkins uses the default language of your browser, if it is set. To change it, do the follow.

1. Download and install the locale plugin:

From the main page of Jenkins, go to Manage Jenkins -> Manage Plugins and Click on Availables. Check the "Locale plugin" and clicks on "Download now and install after restart". Jenkins will download the plugin and restart if not job has been scheduled.

2. Set the language:

Once the plugin has been installed, change the language using following steps: From the main page of Jenkins, go to Manage Jenkins -> Configure System. Under Locale, there will be a field called "Default Language". Enter the new language. It is "en", "en_US" or "ENGLISH".

Under the text box, check the checkBox called "Ignore browser preference and force this language to all users".