|
|
|
# Proxmox
|
|
|
|
You can find Proxmox at [pve.mphslaats.com](https://pve.mphslaats.com).
|
|
|
|
|
|
|
|
## Table of contents
|
|
|
|
- [Proxmox](#proxmox)
|
|
|
|
- [Table of contents](#table-of-contents)
|
|
|
|
- [Resources](#resources)
|
|
|
|
- [Installation](#installation)
|
|
|
|
- [Mount drives](#mount-drives)
|
|
|
|
- [Remove no subscription message](#remove-no-subscription-message)
|
|
|
|
- [Upgrade from 4.x to 5.0](#upgrade-from-4x-to-50)
|
|
|
|
- [Container tweaks](#container-tweaks)
|
|
|
|
- [Root login SSH (Debian)](#root-login-ssh-debian)
|
|
|
|
- [Start service during system startup](#start-service-during-system-startup)
|
|
|
|
- [Start container](#start-container)
|
|
|
|
|
|
|
|
## Resources
|
|
|
|
For Proxmox it is [recommended](https://pve.proxmox.com/wiki/System_Requirements) to have at least 8 GB of RAM, however it can also run on 1 GB.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
* Download the latest Proxmox version [here](https://www.proxmox.com/en/). The roadmap can be found [here](https://pve.proxmox.com/wiki/Roadmap);
|
|
|
|
* Next the BIOS needs to be reset to prevent problems with booting, do not forget to disable safe boot;
|
|
|
|
* Proxmox installation settings:
|
|
|
|
* FQDN: pve.mphslaats.com;
|
|
|
|
* IP-address: x.x.x.2;
|
|
|
|
* Subnet mask: 255.255.255.0;
|
|
|
|
* Gateway: x.x.x.1;
|
|
|
|
* DNS server: x.x.x.2, 8.8.8.8, 8.8.4.4.
|
|
|
|
* Because the [free version](https://serenity-networks.com/how-to-update-proxmox-ve-when-you-do-not-have-a-valid-subscription/) is used, the `/etc/apt/sources.list.d/pve-enterprise.list` file needs to be changed:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
#deb https://enterprise.proxmox.com/debian stretch pve-enterprise
|
|
|
|
|
|
|
|
deb http://download.proxmox.com/debian stretch pve-no-subscription
|
|
|
|
```
|
|
|
|
|
|
|
|
## Mount drives
|
|
|
|
To be able to mount drives during startup the [`/etc/fstab`](https://git.mphslaats.com/mphslaats/server-documentation/blob/master/2-proxmox/fstab) file needs to be edited. More information about the fstab file can be found [here](http://man7.org/linux/man-pages/man5/fstab.5.html)
|
|
|
|
Because the drives were NTFS at first, Proxmox did not automatically mount them, therefore they were formatted into [ext4](https://superuser.com/questions/1228552/mount-drive-rw-in-fstab).
|
|
|
|
Before the fstab files can be tested, the folders need to be created in `/mnt` and there will be a nomedia file to indicate if the drive is mounted or not.
|
|
|
|
To test if the fstab file is correct `mount -a` is used.
|
|
|
|
|
|
|
|
## Remove no subscription message
|
|
|
|
**NOTE:** This option is reverted during a reboot.
|
|
|
|
* Go to `/usr/share/pve-manager/js`;
|
|
|
|
* `cp pvemanagerlib.js pvemanagerlib.js.bak`;
|
|
|
|
* Search for `No subscription` and change the whole `if (data.status !== 'Active')` into `orig_cmd();` in the `pvemanagerlib.js`.
|
|
|
|
|
|
|
|
## Upgrade from 4.x to 5.0
|
|
|
|
To manually update from [version 4.x to 5.0](https://pve.proxmox.com/wiki/Upgrade_from_4.x_to_5.0#Actions_Step_by_Step), do the following:
|
|
|
|
* First update Proxmox by using `apt-get update && apt-get dist-upgrade -y`;
|
|
|
|
* Then use `sed -i 's/jessie/stretch/g' /etc/apt/sources.list && sed -i 's/jessie/stretch/g' /etc/apt/sources.list.d/pve-enterprise.list`;
|
|
|
|
* Now Proxmox can be updated to the latest version using `apt-get update && apt-get dist-upgrade -y`;
|
|
|
|
* If the aptitude tells to use autoremove use it by using `apt-get autoremove -y`.
|
|
|
|
|
|
|
|
## Container tweaks
|
|
|
|
Every time a container is made the following steps are taken to make sure the container is automated and usable with SSH.
|
|
|
|
* Let's start by setting the container ID, the ID corresponds with the last digits of the IP-address of the container. If the digits are lower than 100, 100 + digits is used, i.e. if the IP-address is x.x.x.1, the ID becomes 101. This does not give any trouble since x.x.x.101 - x.x.x.200 are for DHCP lease and not for servers;
|
|
|
|
* The default disksize is 8 GB and can be higher if that is necessary;
|
|
|
|
* The IPv4 network device has to be configured for DHCP since it will get the correct IP-address automatically from the DHCP server;
|
|
|
|
* If the container is instantiated, the generated MAC-address must be copied to the DHCP server and assigned to the correct IP-address;
|
|
|
|
* In the options it is possible to set it to start on boot, this has to be enabled if needed and the boot order corresponds with the last digits of the IP-address;
|
|
|
|
* Do not forget to update the system using:
|
|
|
|
```bash
|
|
|
|
apt-get update && \
|
|
|
|
apt-get dist-upgrade -y && \
|
|
|
|
apt-get autoremove -y && \
|
|
|
|
apt-get autoclean -y
|
|
|
|
```
|
|
|
|
|
|
|
|
### Root login SSH (Debian)
|
|
|
|
To be able [to login in SSH as the root user](https://linuxconfig.org/enable-ssh-root-login-on-debian-linux-server) with a Debian or Debian based container, the `/etc/ssh/sshd_config` needs to be edited. `#PermitRootLogin prohibit-password` needs to be changed to `PermitRootLogin yes`. Finally the SSH service needs to be restarted by using: `service ssh restart`.
|
|
|
|
|
|
|
|
### Start service during system startup
|
|
|
|
* To be able to start a service during system startup we first need a proper user for it, so add a user by using `useradd <user>`;
|
|
|
|
* Now add a service file to `/lib/systemd/system`;
|
|
|
|
* After you created the file run `chown -R <user>:<group> <folder>` on the service folder;
|
|
|
|
* Now start the service using `systemctl start <service>`;
|
|
|
|
* Check it's status by using `systemctl status <service>`;
|
|
|
|
* If that works you can add it to automagically starting with the system by using `systemctl enable <service>`;
|
|
|
|
* That's it, however if you ever run into a problem run `systemctl daemon-reload` to load the latest version of the service file.
|
|
|
|
|
|
|
|
### Start container
|
|
|
|
A container can be started by using `lxc-start -F -n <container id>`.
|
|
|
|
If a container or virtual machine does not start, virtualization needs to be enabled in the BIOS. To check if this is the case use `dmesg | grep kvm`. If it says disabled, KVM needs to be enabled in the BIOS.
|
|
|
|
|
|
|
|
[Home](https://git.mphslaats.com/mphslaats/server-documentation/wikis/home) |
|
|
|
\ No newline at end of file |