---
title: Proxmox tricks
description: 
published: 1
date: 2024-02-03T20:22:54.801Z
tags: 
editor: markdown
dateCreated: 2024-02-01T19:16:08.517Z
---



    @page { size: 8.27in 11.69in; margin: 0.79in } p { line-height: 115%; margin-bottom: 0.1in; background: transparent } h1 { margin-bottom: 0.08in; background: transparent; page-break-after: avoid } h1.western { font-family: "Liberation Sans", sans-serif; font-size: 18pt; font-weight: bold } h1.cjk { font-family: "Noto Sans CJK SC"; font-size: 18pt; font-weight: bold } h1.ctl { font-family: "Lohit Devanagari"; font-size: 18pt; font-weight: bold } h2 { margin-top: 0.14in; margin-bottom: 0.08in; background: transparent; page-break-after: avoid } h2.western { font-family: "Liberation Serif", serif; font-size: 18pt; font-weight: bold } h2.cjk { font-family: "Noto Serif CJK SC"; font-size: 18pt; font-weight: bold } h2.ctl { font-family: "Lohit Devanagari"; font-size: 18pt; font-weight: bold } pre { background: transparent } pre.western { font-family: "Liberation Mono", monospace; font-size: 10pt } pre.cjk { font-family: "Noto Sans Mono CJK SC", monospace; font-size: 10pt } pre.ctl { font-family: "Liberation Mono", monospace; font-size: 10pt } h3 { margin-top: 0.1in; margin-bottom: 0.08in; background: transparent; page-break-after: avoid } h3.western { font-family: "Liberation Sans", sans-serif; font-size: 14pt; font-weight: bold } h3.cjk { font-family: "Noto Sans CJK SC"; font-size: 14pt; font-weight: bold } h3.ctl { font-family: "Lohit Devanagari"; font-size: 14pt; font-weight: bold } a:link { color: #000080; text-decoration: underline } code.western { font-family: "Liberation Mono", monospace } code.cjk { font-family: "Noto Sans Mono CJK SC", monospace } code.ctl { font-family: "Liberation Mono", monospace } a:visited { color: #800000; text-decoration: underline }

  

<mark>Marked text</mark>
<span style="background-color: #FFFF00">Marked text</span>

<br/><br/>




# Proxmox

  

[https://github.com/tteck/Proxmox?tab=readme-ov-file](https://github.com/tteck/Proxmox?tab=readme-ov-file)

  

  

  

Pve login? root, borabora

  

Proxmox: https://192.168.178.111:8006/, root, borabora, [boraers@gmail.com](mailto:boraers@gmail.com), xy.proxmoxBE.lan

portainer: http://192.168.178.23:9000/, admin, boraborabora

Unraid server: http://192.168.178.23:8080/, Bora, bora90bora

  

  

  

  

Ubuntu upgrade to the latest version

sudo do-release-upgrade

  

figure out IP address of VM/container:

lxc-info -n 111

  

  

## avoid suspending after closing laptop lid

[https://www.reddit.com/r/Proxmox/comments/kxdjrc/i\_am\_running\_proxmox\_on\_a\_thinkpad\_laptop\_how\_can/](https://www.reddit.com/r/Proxmox/comments/kxdjrc/i_am_running_proxmox_on_a_thinkpad_laptop_how_can/)

I’m doing this from memory, so google will help you verify, but there’s an option in /etc/systemd/logind.conf that should help. Uncomment the line about HandleLidSwitch=suspend and change suspend to ignore. Save and close that and restart systemd-logind and you should be in business.

\>> nano /etc/systemd/logind.conf

Uncomment the line about HandleLidSwitch=suspend and change suspend to ignore

\>>systemctl restart systemd-logind

  

  

  

  

  

  
<br/><br/>
# Nextcloud

  

[https://www.wundertech.net/install-nextcloud-on-proxmox/](https://www.wundertech.net/install-nextcloud-on-proxmox/)

  

in console of LXC container: pct enter 100

\>> root >> borabora

  

apt update && apt upgrade -y

apt install curl -y

curl -sSL https://get.docker.com/ | sh

docker run --restart always -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer\_data:/data portainer/portainer-ce

  

figure out IP address: ip addr >> eth0@if12

\>> http://\[CONTAINER\_IP\]:9000

http://<mark>192.168.178.23</mark>:9000


  
<br/><br/>
  

**in portainer:**

  

version: '2'

  

services:

db:

image: mariadb:10.5

restart: always

command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW

volumes:

\- /var/lib/docker/volumes/Nextcloud\_Database:/var/lib/mysql

environment:

\- MYSQL\_ROOT\_PASSWORD=<mark>password</mark>

\- MYSQL\_PASSWORD=<mark>password</mark>

\- MYSQL\_DATABASE=nextcloud

\- MYSQL\_USER=nextcloud

  

app:

image: nextcloud

restart: always

ports:

\- 8080:80

links:

\- db

volumes:

\- /var/lib/docker/volumes/Nextcloud\_Application:/var/www/html

environment:

\- MYSQL\_PASSWORD=<mark>password</mark>

\- MYSQL\_DATABASE=nextcloud

\- MYSQL\_USER=nextcloud

\- MYSQL\_HOST=db

  

  

  

  

  
<br/><br/>
# Homeassistant VM

  

[https://community.home-assistant.io/t/home-assistant-os-haos-with-proxmox-ve-8-0-install-guide/584972](https://community.home-assistant.io/t/home-assistant-os-haos-with-proxmox-ve-8-0-install-guide/584972)

[https://www.derekseaman.com/2023/10/home-assistant-proxmox-ve-8-0-quick-start-guide-2.html](https://www.derekseaman.com/2023/10/home-assistant-proxmox-ve-8-0-quick-start-guide-2.html)

  

bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/post-pve-install.sh)"

  

bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/vm/haos-vm.sh)"

  

http://192.168.178.43:8123

  

Test, bora

  

samba share: homeassistant, sharemyHA, WORKGROUP

[smb://192.168.178.43](smb://192.168.178.43/)

  

<br/><br/>

network storage on fritz.nas

Name: fritzbox

Server: fritz.nas

Remote Share: fritz.nas/USB-SanDisk3-2Gen1-01/Data

Username: see Keepass

Password:

  

  

<br/><br/>

configure static IP address:

in HA: 192.168.178.43/24, 192.168.178.1, 192.168.178.1

in Fritzbox: 192.168.178.43

  

  

<br/><br/>

deConz: ConbeeIII, testtest

  

<br/><br/>

[smb://fritz.nas](smb://fritz.nas/)

homeassistant, \*\*\*, WORKGROUP

  


<br/><br/>
# MQTT Broker

[https://smarthomescene.com/guides/how-to-separate-zigbee2mqtt-from-home-assistant-in-proxmox/](https://smarthomescene.com/guides/how-to-separate-zigbee2mqtt-from-home-assistant-in-proxmox/)

  

bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/mqtt.sh)"

  

~~http://192.168.178.80:1883~~

fixed IP, identical to previous HA installation:
http://192.168.178.52:1883

  

sudo mosquitto\_passwd -c /etc/mosquitto/passwd <mark>root</mark>

  

password: mqtt4bora

  

sudo nano /etc/mosquitto/conf.d/default.conf

  

sudo systemctl restart mosquitto

sudo /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

  

<br/><br/>

**do not forget:**

chown mosquitto:mosquitto /etc/mosquitto/passwd

  

chown root /etc/mosquitto/passwd

  

  

topic\_pub = f"homeassistant/sensor/node\_{node.nodeNumber}/state"

  

  

<br/><br/>

add new user:

[https://stackoverflow.com/questions/41396710/adding-users-in-mqtt-broker](https://stackoverflow.com/questions/41396710/adding-users-in-mqtt-broker)

sudo mosquitto\_passwd -c /etc/mosquitto/passwd note4

note4


<br/><br/>

**attention**: when migrating HAOS, the user/pswd of mqtt must be identical for correct operation of Tasmota, Shelly and Mycropython devices




### Zigbee2MQTT
https://github.com/zigbee2mqtt/hassio-zigbee2mqtt
https://www.zigbee2mqtt.io/guide/adapters/#recommended
https://smarthomecircle.com/install-zigbee2mqtt-with-home-assistant#setting-up-zigbee2mqtt-as-a-home-assistant-add-on


socat
enabled: false
master: pty,raw,echo=0,link=/tmp/ttyZ2M,mode=777
slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
options: "-d -d"
log: false

mqtt
server: mqtt://192.168.178.52:1883
user: note4
password: note4

serial
port: /dev/ttyUSB0
adapter: deconz
baudrate: 115200


Bosch radiator thermostat
FC32-9603-E07B
5182-1390-11E8
209B-5433-A903
RB01SG0D8310182648008000000000000000000018FC2600000615BDDLKFC329603E07B5182139011E8209B5433A9D3



Philips Hue lamps
first add the lamp to the Hue app
upon deleting the lamp from the app, it should be automatically be recognized by Z2M

C66DE4



Philips Hue motion sensor
simply press the button on the bacside for 10 s



  
<br/><br/>
## Wiki.js LXC

https://tteck.github.io/Proxmox/

http://192.168.178.26:3000/, borabora, [boraers@gmail.com](mailto:boraers@gmail.com)

https://wiki.mywiki.com

  

diagrams can be created by inserting “diagram” from the left panel on Markdown pages



homeassistant/sensor/node_2/state
zigbee2mqtt/bridge/response/device/bind
zigbee2mqtt/bridge/log
zigbee2mqtt/bridge/response/device/unbind



<br/><br/>
### Backing up all pages on github

how to access the file system of a proxmox container?

  

[https://www.reddit.com/r/Proxmox/comments/fap1wx/beginner\_question\_where\_are\_container\_filesystems/](https://www.reddit.com/r/Proxmox/comments/fap1wx/beginner_question_where_are_container_filesystems/)

find / -size +500M -ls

/var/lib/lxc/103/rootfs/

  

lvdisplay

/dev/pve/vm-103-disk-0

  

  

<br/><br/>

<mark>using github:</mark>

[https://docs.requarks.io/storage/git](https://docs.requarks.io/storage/git)

ssh-keygen -t rsa -b 4096

/root/.ssh/id\_rsa

Your identification has been saved in /root/.ssh/id\_rsa

Your public key has been saved in /root/.ssh/id\_rsa.pub

The key fingerprint is:

SHA256:JmrdPXntGuqgopWrbAquqhZIGuy5rdo2vGLr/BHm3k4 root@wikijs

The key's randomart image is:

+---\[RSA 4096\]----+

| |

| |

|. |

|.o |

|=..o . S |

|o+o .+ + . . . |

|..+o=E. o + o . |

|=\*\*+=. . . + o |

|#@XBo+. .o ... |

+----\[SHA256\]-----+

  

\>>nano /root/.ssh/id\_rsa.pub

[https://unix.stackexchange.com/questions/122795/long-line-wrapping-in-nano](https://unix.stackexchange.com/questions/122795/long-line-wrapping-in-nano)

!!complicated copy procedure: esc → shift+4 → mar everything with mouse → Alt+6 or right mouse!!

ssh-rsa   root@wikijs

  

  
<br/><br/>

TARGET CONFIGURATION

​

Authentication Type

ssh

Use SSH for maximum security.

​

Repository URI

git@github.com:BoraEr90/WikiJS.git

Git-compliant URI (e.g. git@github.com:org/repo.git for ssh, https://github.com/org/repo.git for basic)

​

Branch

main

The branch to use during pull / push

​

SSH Private Key Mode

path

SSH Authentication Only - The mode to use to load the private key. Fill in the corresponding field below.

​

A - SSH Private Key Path

/root/.ssh/id\_rsa

SSH Authentication Only - Absolute path to the key. The key must NOT be passphrase-protected. Mode must be set to path to use this option.

​

B - SSH Private Key Contents

SSH Authentication Only - Paste the contents of the private key. The key must NOT be passphrase-protected. Mode must be set to contents to use this option.

Some hosts requires SSL certificate checking to be disabled. Leave enabled for proper security.

​

Username

Basic Authentication Only

​

Password / PAT

Basic Authentication Only

​

Default Author Email

boraers@gmail.com

Used as fallback in case the author of the change is not present.

​

Default Author Name

BoraEr90

Used as fallback in case the author of the change is not present.

​

Local Repository Path

/root/repo

Path where the local git repository will be created.

​

Git Binary Path

Optional - Absolute path to the Git binary, when not available in PATH. Leave empty to use the default PATH location (recommended).

SYNC DIRECTION

Choose how content synchronization is handled for this storage target.

Bi-directional

In bi-directional mode, content is first pulled from the storage target. Any newer content overwrites local content. New content since last sync is then pushed to the storage target, overwriting any content on target if present.

Push to target

Content is always pushed to the storage target, overwriting any existing content. This is safest choice for backup scenarios.

Pull from target

Content is always pulled from the storage target, overwriting any local content which already exists. This choice is usually reserved for single-use content import. Caution with this option as any local content will always be overwritten!

SYNC SCHEDULE

For performance reasons, this storage target synchronize changes on an interval-based schedule, instead of on every change. Define at which interval should the synchronization occur.

Every

5

Minute(s)

0

Hour(s)

0

Day(s)

0

Month(s)

0

Year(s)

Currently set to every 5 minutes.

The default is every 5 minutes.

  

  

  

  

<br/><br/>

### using self-hosted gitea

[https://www.reddit.com/r/wikijs/comments/uyfjlz/help\_cannot\_use\_storage\_targets/](https://www.reddit.com/r/wikijs/comments/uyfjlz/help_cannot_use_storage_targets/)

  

  

[https://www.youtube.com/watch?v=NaKExFTCKtg](https://www.youtube.com/watch?v=NaKExFTCKtg)

  

192.168.178.79

attention: DHCP to be activated manually!

  

root, mygit90

  

<br/><br/>

#Install git

apt update && apt install git -y

#Get the correct download link for the latest version

wget https://dl.gitea.com/gitea/1.21.4/gitea-1.21.4-linux-amd64

#Move the binary to bin

mv gitea\* /usr/local/bin/gitea

#Make executable

chmod +x /usr/local/bin/gitea

#Ensure it works

gitea --version

#Create the user/group for gitea to operate as

adduser --system --group --disabled-password --home /etc/gitea gitea

#Config directory was created by adduser

#Create directory structure (mountpoint should be /var/lib/gitea)

mkdir -p /var/lib/gitea/{custom,data,log}

chown -R gitea:gitea /var/lib/gitea/

chmod -R 750 /var/lib/gitea/

chown root:gitea /etc/gitea

chmod 770 /etc/gitea

  


<br/><br/>

checking permission:

ls -l

/var/lib/gitea/lost+found

  

rmdir /var/lib/gitea/

rm -r -f /var/lib/gitea/

  

lsof +D /var/lib/gitea/

  

umount /var/lib/gitea

  

lsof +D /var/lib/gitea | awk '{print $2}' | tail -n +2 | xargs -r kill -9



<br/><br/>

**need to delete the Linux lost+found directory to avoid issues with changing permissions:**

[https://www.baeldung.com/linux/lost-found-directory](https://www.baeldung.com/linux/lost-found-directory)

find "-iname" lost+found -type d -exec rm -r "{}" \\;

  

  

  

<br/><br/>

nano /etc/systemd/system/gitea.service

→ copy code from aforementioned instruction webpage

  

ip a

192.168.178.79/24

fe80::be24:11ff:fee4:4091/64

  

systemctl daemon-reload

systemctl enable --now gitea

  

→ configure via web gui: [http://192.168.178.79:3000/](http://192.168.178.79:3000/)

  

admin\_bora, [boraers@gmail.com](mailto:boraers@gmail.com), mygit90

  

after isntallation: [http://192.168.178.79:80/](http://192.168.178.79:80/)

  

[http://192.168.178.79:3000/admin\_bora/WikiJS.git](http://192.168.178.79:3000/admin_bora/WikiJS.git)

  

gitea@192.168.178.79:admin\_bora/WikiJS.git

instead of git@github.com:BoraEr90/WikiJS.git

  

  

<br/><br/>

TARGET CONFIGURATION

​

Authentication Type

basic

Use SSH for maximum security.

​

Repository URI

http://192.168.178.79:80/admin\_bora/WikiJS.git

Git-compliant URI (e.g. git@github.com:org/repo.git for ssh, https://github.com/org/repo.git for basic)

​

Branch

main

The branch to use during pull / push

​

SSH Private Key Mode

path

SSH Authentication Only - The mode to use to load the private key. Fill in the corresponding field below.

​

A - SSH Private Key Path

/root/.ssh/id\_rsa

SSH Authentication Only - Absolute path to the key. The key must NOT be passphrase-protected. Mode must be set to path to use this option.

​

B - SSH Private Key Contents

SSH Authentication Only - Paste the contents of the private key. The key must NOT be passphrase-protected. Mode must be set to contents to use this option.

Some hosts requires SSL certificate checking to be disabled. Leave enabled for proper security.

​

Username

admin\_bora

Basic Authentication Only

​

Password / PAT

mygit90

Basic Authentication Only

​

Default Author Email

boraers@gmail.com

Used as fallback in case the author of the change is not present.

​

Default Author Name

admin\_bora

Used as fallback in case the author of the change is not present.

​

Local Repository Path

/root/repo

Path where the local git repository will be created.

​

Git Binary Path

Optional - Absolute path to the Git binary, when not available in PATH. Leave empty to use the default PATH location (recommended).

SYNC DIRECTION

Choose how content synchronization is handled for this storage target.

Bi-directional

In bi-directional mode, content is first pulled from the storage target. Any newer content overwrites local content. New content since last sync is then pushed to the storage target, overwriting any content on target if present.

Push to target

Content is always pushed to the storage target, overwriting any existing content. This is safest choice for backup scenarios.

Pull from target

Content is always pulled from the storage target, overwriting any local content which already exists. This choice is usually reserved for single-use content import. Caution with this option as any local content will always be overwritten!

SYNC SCHEDULE

For performance reasons, this storage target synchronize changes on an interval-based schedule, instead of on every change. Define at which interval should the synchronization occur.

Every

5

Minute(s)

0

Hour(s)

0

Day(s)

0

Month(s)

0

Year(s)

Currently set to every 5 minutes.

The default is every 5 minutes.

  

![Alt text_proxmox_html_11fce3e5bceb2438 >](/pictures/proxmox_html_11fce3e5bceb2438.png "The Insert Assets Tool" =200x){.align-center}

![The San Juan Mountains are beautiful!](/pictures/proxmox_html_8cda42542491ee35.png "The Insert Assets Tool" =200x){: .floatright}

![Alt text_proxmox_html_11fce3e5bceb2438 >](/pictures/proxmox_html_11fce3e5bceb2438.png "The Insert Assets Tool" =200x){.align-center}







<br/><br/>
### markdown syntax

[https://www.markdownguide.org/tools/wiki-js/](https://www.markdownguide.org/tools/wiki-js/)

  

  

[https://docs.requarks.io/en/editors/markdown](https://docs.requarks.io/en/editors/markdown)

  

  

  

convert doc and odt to markdown: use pandoc

[https://stackoverflow.com/questions/16383237/how-can-doc-docx-files-be-converted-to-markdown-or-structured-text](https://stackoverflow.com/questions/16383237/how-can-doc-docx-files-be-converted-to-markdown-or-structured-text)

https://writing.stackexchange.com/questions/9056/from-markdown-to-odt-and-vice-versa-a-possible-distraction-free-writing-workfl
You indeed want to convert to HTML first:

`pandoc OdtFile.odt -o HtmlFile.html`

and then proceed to create markdown file the same way:

`pandoc HtmlFile.html -o MarkDown.text`

https://discourse.suttacentral.net/t/converting-from-word-processor-to-markdown/21

https://pandoc.org/MANUAL.html

pandoc -f markdown -t latex hello.txt
pandoc -f html -t markdown hello.html
pandoc -f html -t markdown_strict hello.html
pandoc -f html -t markdown_strict "Linux LAMP server.html"
pandoc -f html -t markdown_strict "Linux LAMP server.html" -o "Linux LAMP server.md"
pandoc -f html -t markdown "Home_assistant.html" -o "Home_assistant.md"

  

  
<br/><br/>
## deCONZ LXC

http://192.168.178.70

root, borabora

ConbeeIII, borabora

  

<br/><br/>

[https://tisgoud.nl/2020/08/conbee-in-home-assistant-on-proxmox/](https://tisgoud.nl/2020/08/conbee-in-home-assistant-on-proxmox/)

\>>lsusb

deCONZ shows up as ‘Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)’. Notice the ID of the device ‘<mark>ID 0403:6015</mark>’.

\>>qm list

101 proxmoxhaos

\>>qm set <mark>101</mark> -usb0 host=<mark>0403:6015</mark>

  

Settings > System > Hardware > All hardware

Device path: /dev/ttyUSB0

ID: /dev/serial/by-id/usb-dresden\_elektronik\_ConBee\_III\_DE03188934-if00-port0

  


<br/><br/>

[https://wiki.fhem.de/wiki/Conbee/deCONZ\_im\_Proxmox\_LXC-Container\_(Tutorial)](https://wiki.fhem.de/wiki/Conbee/deCONZ_im_Proxmox_LXC-Container_(Tutorial))

\>>ls /dev/ttyUSB\*

/dev/<mark>ttyUSB0</mark>

\>>lsusb

Bus 002 Device 002: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)

\>>ls -l /dev/bus/usb/<mark>002/002</mark>

crw-rw-r-- 1 root root <mark>189</mark>, 8 Jan 21 19:54 /dev/bus/usb/002/002

\>> cd /etc/pve/local/lxc/

\>> nano \<CONTAINER-ID\>.conf

lxc.cgroup.devices.allow: c <mark>189</mark>:\* rwm

lxc.mount.entry: <mark>/dev/bus/usb/002/002 dev/bus/usb/002/002</mark> none bind,optional,create=file

lxc.cgroup.devices.allow: c 188:\* rwm

lxc.mount.entry: /dev/<mark>ttyUSB0</mark> dev/<mark>ttyUSB0</mark> none bind,optional,create=file

LXC>>sudo reboot now

LXC>>ls -l /dev/bus/usb/002/002

LXC>>ls -l /dev/ttyUSB\*

node>>chmod o+rw /dev/ttyUSB0

node>>ls -l /dev/ttyUSB0

LXC>>ls -l /dev/ttyUSB0

node>>nano /etc/udev/rules.d/50-lxcusb.rules

SUBSYSTEMS=="usb", ATTRS{idVendor}=="<mark>0403</mark>", ATTRS{idProduct}=="<mark>6015</mark>", GROUP="users", MODE="0666"

LXC>>sudo systemctl enable deconz

  

  

  
<br/><br/>
## Deconz in Ubuntu VM

bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/vm/ubuntu-vm.sh)"

  

<br/><br/>

root, borabora

192.168.178.76

  

  

<br/><br/>

https://phoscon.de/en/conbee/install#ubuntu

  

  

  

  
<br/><br/>
## Grafana

http://192.168.178.63:3000

admin, admin → borabora

  
<br/><br/>

[https://www.derekseaman.com/2023/04/home-assistant-installing-grafana-lxc.html](https://www.derekseaman.com/2023/04/home-assistant-installing-grafana-lxc.html)

  

  

  
<br/><br/>
## InfluxDB LXC

~~http://192.168.178.64:8086~~

~~version 2~~ and Telegraf installed

  

nano /etc/influxdb/influxdb.conf

nano /etc/telegraf/telegraf.conf

  

[https://www.derekseaman.com/2023/04/home-assistant-installing-influxdb-lxc.html](https://www.derekseaman.com/2023/04/home-assistant-installing-influxdb-lxc.html)

http://192.168.178.68:8888

If you don’t know the IP of your container type >>ip a

  

[https://www.influxdata.com/downloads/](https://www.influxdata.com/downloads/)

root, salzbrezel

wget https://dl.influxdata.com/chronograf/releases/chronograf\_1.10.2\_amd64.deb

  

homeassistant, savemydata

  

  
<br/><br/>
## Mariadb LXC

http://192.168.178.65

adminer installed

  
<br/><br/>

The subsequent step involves executing the included security script. This script modifies certain default options that are less secure. Our purpose for running it is to prevent remote root logins and eliminate unnecessary database users.

Run the security script:

  

  
<br/><br/>

\>>mysql\_secure\_installation

Enter current password for root (enter for none): enter

  

Switch to unix\_socket authentication \[Y/n\] y

  

Change the root password? \[Y/n\] n

  

Remove anonymous users? \[Y/n\] y

  

Disallow root login remotely? \[Y/n\] y

  

Remove test database and access to it? \[Y/n\] y

  

Reload privilege tables now? \[Y/n\] y

  

<br/><br/>
We will create a new account called admin with the same capabilities as the root account, but configured for password authentication.

  

  
\>>mysql

Prompt will change to MariaDB \[(none)\]>

  
<br/><br/>
Create a new local admin (Change the username and password to match your preferences)

  

  

\>>CREATE USER 'admin'@'localhost' IDENTIFIED BY 'password';

\>>CREATE USER 'admin'@'localhost' IDENTIFIED BY 'salzbrezel';


<br/><br/>
Give local admin root privileges (Change the username and password to match above)

  

  

\>>GRANT ALL ON \*.\* TO 'admin'@'localhost' IDENTIFIED BY 'salzbrezel' WITH GRANT OPTION;


<br/><br/>
Now, we'll give the user admin root privileges and password-based access that can connect from anywhere on your local area network (LAN), which has addresses in the subnet 192.168.100.0/24. This is an improvement because opening a MariaDB server up to the Internet and granting access to all hosts is bad practice.. Change the username, password and subnet to match your preferences:

  

  

\>>GRANT ALL ON \*.\* TO 'admin'@'192.168.178.%' IDENTIFIED BY 'salzbrezel' WITH GRANT OPTION;


<br/><br/>
Flush the privileges to ensure that they are saved and available in the current session:

  

  

\>>FLUSH PRIVILEGES;


<br/><br/>
command below this, exit the MariaDB shell:

  

  

\>>exit


<br/><br/>
Log in as the new database user you just created:

  

  

\>>mysql -u admin -p


<br/><br/>
Create a new database:

  

  

\>>CREATE DATABASE homeassistant;


<br/><br/>
command below this, exit the MariaDB shell:

  

  

\>>exit


<br/><br/>
⚠️ Reboot the lxc

  

<br/><br/>
Checking status.

  

  

\>>systemctl status mariadb


<br/><br/>
Change the recorder: db\_url: in your HA configuration.yaml

  

**Example:**

  

  

recorder:

db\_url: mysql://<mark>admin:salzbrezel@192.168.178.65</mark>:3306/homeassistant?charset=utf8mb4

⚙️ Adminer is a full-featured database management tool

  

Adminer Interface: <mark>192.168.178.65</mark>/adminer/

  

  

  

  

<br/><br/>

[https://smarthomescene.com/guides/moving-home-assistants-database-to-mariadb-on-proxmox/](https://smarthomescene.com/guides/moving-home-assistants-database-to-mariadb-on-proxmox/)

Delaying Container Startup Time

  

Select the MariaDB container on the left

Click Options in the middle column

Double click Start/Shutdown order

Set Start/Shutdown order: 1

Set Startup Delay: 240

This setting essentially tells Proxmox that the MariaDB LXC needs to be started before any other VMs or Containers. It also sets a 240 seconds delay for starting subsequent containers. LXCs without a Start/Shutdown order parameter will always start after those where the parameter is set.

  

  

  

  


<br/><br/>
## AdGuard Home LXC

[http://192.168.178.](http://192.168.178.67:3000/)[6](http://192.168.178.67:3000/)[7:3000](http://192.168.178.67:3000/)

admin, salzbrezel

  
<br/><br/>

AdGuard Home Setup Interface: IP:3000 (After Setup use only IP)

(For the Home Assistant Integration, use port 80 not 3000)

  
<br/><br/>

127.0.0.1

192.168.178.67

::1

fe80::be24:11ff:fee1:a5a9%eth0

  

  

  

  
<br/><br/>
## Frigate

[https://www.homeautomationguy.io/blog/running-frigate-on-proxmox](https://www.homeautomationguy.io/blog/running-frigate-on-proxmox)

  
<br/><br/>

http://192.168.178.69:9000

admin, takesomepics

  

  

  
<br/><br/>
## VS Code Server

https://www.kentoseth.com/posts/2021/may/28/how-to-install-visual-studio-codevscode-inside-an-lxc-container/

  

  

  

  
<br/><br/>
# Nginx Proxy Manager LXC

bash -c "$(wget -qLO - [https://github.com/tteck/Proxmox/raw/main/ct/nginxproxymanager.sh](https://github.com/tteck/Proxmox/raw/main/ct/nginxproxymanager.sh))"

  

[http://192.168.178.77:81](http://192.168.178.77:81/)

  

Bora, BE, boraer@gmail.com

forwardmyports00

  

<br/><br/>

**add to configuration.yaml**

http:

use\_x\_forwarded\_for: true

trusted\_proxies:

\- 192.168.178.77 ###(Nginx Proxy Manager LXC IP)###

  

<br/><br/>

[https://peyanski.com/home-assistant-remote-access-using-nginx/](https://peyanski.com/home-assistant-remote-access-using-nginx/)

[https://theprivatesmarthome.com/how-to/set-up-nginx-proxy-manager-in-home-assistant/](https://theprivatesmarthome.com/how-to/set-up-nginx-proxy-manager-in-home-assistant/)

[https://theprivatesmarthome.com/how-to/put-home-assistant-behind-existing-nginx-proxy-manager/](https://theprivatesmarthome.com/how-to/put-home-assistant-behind-existing-nginx-proxy-manager/)

  

  

  

  

  
<br/><br/>
# GPU underclock & undervolt

[https://graphicsreport.com/how-to-underclock-gpu/](https://graphicsreport.com/how-to-underclock-gpu/)

[https://www.reddit.com/r/linux\_gaming/comments/bx9247/comment/eq6m7tg/?utm\_source=share&utm\_medium=web3x&utm\_name=web3xcss&utm\_term=1&utm\_content=share\_button](https://www.reddit.com/r/linux_gaming/comments/bx9247/comment/eq6m7tg/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button)

  

  

  
<br/><br/>

[https://wiki.archlinux.org/title/NVIDIA/Tips\_and\_tricks#Enabling\_overclocking](https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Enabling_overclocking)

Note:

Overclocking settings cannot be applied if the Xorg server is running in rootless mode. Consider running Xorg as root.

Enabling DRM kernel mode setting may cause overclocking to become unavailable, regardless of the Coolbits value.

Overclocking is controlled via Coolbits option in the Device section, which enables various unsupported features:

  

Option "Coolbits" "value"

Tip: The Coolbits option can be easily controlled with the nvidia-xconfig, which manipulates the Xorg configuration files:

\# nvidia-xconfig --cool-bits=value

The Coolbits value is the sum of its component bits in the binary numeral system. The component bits are:

  

1 (bit 0) - Enables overclocking of older (pre-Fermi) cores on the Clock Frequencies page in nvidia-settings.

2 (bit 1) - When this bit is set, the driver will "attempt to initialize SLI when using GPUs with different amounts of video memory".

4 (bit 2) - Enables manual configuration of GPU fan speed on the Thermal Monitor page in nvidia-settings.

8 (bit 3) - Enables overclocking on the PowerMizer page in nvidia-settings. Available since version 337.12 for the Fermi architecture and newer.\[4\]

16 (bit 4) - Enables overvoltage using nvidia-settings CLI options. Available since version 346.16 for the Fermi architecture and newer.\[5\]

  

To enable multiple features, add the Coolbits values together. For example, to enable overclocking and overvoltage of Fermi cores, set Option "Coolbits" "24".

  

The documentation of Coolbits can be found in /usr/share/doc/nvidia/html/xconfigoptions.html and here.

  

  

  
<br/><br/>
[https://devicetests.com/ubuntu-20-04-gpu-fan-control](https://devicetests.com/ubuntu-20-04-gpu-fan-control)


<br/><br/>
## Understanding Coolbits

Coolbits is a feature provided by NVIDIA that allows users to manipulate several advanced properties of the NVIDIA graphics driver. These properties include GPU clock offsets, memory transfer rate offsets, and fan speed control. The value of Coolbits is a sum of its component bits in the binary numeral system. For example, a Coolbits value of 4 enables manual GPU fan control.

## Prerequisites

Before we begin, ensure you have administrative privileges on your Ubuntu 20.04 system and the NVIDIA graphics driver installed.

## Step 1: Editing the X Configuration File

First, we need to edit the X configuration file. Open the terminal and run the following command:

`sudo nano /etc/X11/xorg.conf`

This command uses the `nano` text editor to open the `xorg.conf` file located in the `/etc/X11/` directory. The `sudo` command is used to run operations that require administrative privileges.

In the file, locate the “Device” section. Here, you need to add the line `Option "Coolbits" "4"`. The “Device” section should look something like this:

`Section "Device"`
 `Identifier "Device0"`
 `Driver "nvidia"`
 `VendorName "NVIDIA Corporation"`
 `BoardName "GeForce GTX 1070"`
 `Option "Coolbits" "4"`
`EndSection`

Press `Ctrl + O` to save the file, then `Ctrl + X` to exit the editor.

## Step 2: Editing the Xwrapper Configuration File

Next, we need to edit the Xwrapper configuration file. Run the following command in terminal:

`sudo nano /etc/X11/Xwrapper.config`

In the file, locate the line that starts with `allowed_users=`. Comment it out by adding a `#` at the beginning. It should look like this:

`# allowed_users=console`

Below the commented line, add the following two lines:

`allowed_users = anybody`
`needs_root_rights = yes`

The `allowed_users = anybody` line allows any user to start the X server. The `needs_root_rights = yes` line grants the X server root rights, which are necessary for Coolbits to function correctly.

Press `Ctrl + O` to save the file, then `Ctrl + X` to exit the editor.

## Step 3: Changing the Permissions of the Xwrapper Configuration File

Finally, we need to change the permissions of the Xwrapper configuration file. Run the following command in terminal:

`sudo chmod 2644 /etc/X11/Xwrapper.config`

This command changes the permissions of the `Xwrapper.config` file to 2644. In this permission set, the owner can read and write the file, while the group and others can only read the file.

## Step 4: Rebooting the System

Reboot your computer for the changes to take effect. You can do this by running the following command:

`sudo reboot`

## Conclusion

By following these steps, you should be able to set the Coolbits in Ubuntu 20.04 and enable manual GPU fan control. Remember to adjust the Coolbits value according to your requirements. For more information on Coolbits and its different values, you can refer to the [NVIDIA documentation](https://download.nvidia.com/XFree86/Linux-x86_64/435.21/README/xconfigoptions.html).





<br/><br/>
# TrueNAS






