# Proxmox VE

## Proxmox Install

1. Get the latest ISO image from <https://proxmox.com/en/downloads>
2. Use Balena Etcher (Linux) or Rufus(Windows) to flash on to Bootable USB
3. Boot into Proxmox Installer
4. Log in to router and get the DHCP information
   1. Make a note of the addressable range in your current config. If the last address is .254, this needs to be adjusted to limit the space available so the next static IP can be assigned to Proxmox device
   2. In this test enviroment, the router is limited the scope from `.2` to `.100` for other devices in the network so that proxmox can use `.101`

      <figure><img src="/files/msXfVjI1AqTykc9liZ5Z" alt=""><figcaption></figcaption></figure>
5. Configure the next available or desired Static IP for Proxmox during installation process
6. Configure the DNS IP to the local DNS router or a preferred public DNS
   1. In this test case, The local IP address of the router on the same network was used as DNS
7. Make a note of the local IP address and port number provided after installation is complete (usually port 8006 on IP configured)

## Post-Install Configs

<h3 align="center">Helper Script</h3>

1. Login to the Proxmox Web UI using the password configured during OS installation

2. Click the node in the datacenter section of the server view. The default is PVE unless renamed during install

3. In the node menu, select shell
   1\.

   ```
   <figure><img src="/files/RVgwFh5oeVcOuNDgFwyT" alt=""><figcaption></figcaption></figure>
   ```

4. Run the below command for a good header response to ensure that Proxmox is connected to the internet and a working DNS is confirgured properly:

   ```
   curl -I https://raw.githubusercontent.com
   ```

   1. If your DNS queries are not working feel free to modify your resolve.conf file within proxmox shell with similar command as below
      1. ```
         echo "nameserver 194.242.2.4" > /etc/resolv.conf
         ```

5. In the browser of the remote connected device, visit <https://community-scripts.github.io/ProxmoxVE/> and locate the Post-Install helper script for Proxmox

6.

```
<figure><img src="/files/fYSS7cqz9OP9u3ircNdV" alt=""><figcaption></figcaption></figure>
```

7. Copy the command and paste into Proxmox Shell
   1. Description from the helper scripts project - "This script provides options for managing Proxmox VE repositories, including disabling the Enterprise Repo, adding or correcting PVE sources, enabling the No-Subscription Repo, adding the test Repo, disabling the subscription nag, updating Proxmox VE, and rebooting the system."

      <figure><img src="/files/zfhJW7Tg47PIjIWcDd2g" alt=""><figcaption></figcaption></figure>

8. Type `y` to start the installation process

9. If you are not using Enterprise, Corosync, etc ensure to ponly enable the `No-Subscription` repo during installation

<h3 align="center">Installing VM ISOs</h3>

#### Install via URL

1. Visit the website with the desired OS and locate the specific dowload link.

2. Right-click the link and copy the raw download URL address
   1\.

   ```
   <figure><img src="/files/JTBJyPdZa24IZFCDarhX" alt=""><figcaption></figcaption></figure>
   ```

3. Click the local storage for the desired node

4. In the storage menu click the `ISO images` tab and then download from URL

5. Paste the Download URL in the Download from URL window
   1. Select `Query URL` to ensure the download will resolve successfully with correct ISO.&#x20;

      <figure><img src="/files/1MCtewLhrkb17Jg1Ff5a" alt=""><figcaption></figcaption></figure>

   2. Download button will not work if this is not correct.

      <figure><img src="/files/ceucvEogNOwzJN31Ui7g" alt=""><figcaption></figcaption></figure>

6. Start the Download and monitor for `Task OK` status at bottom of window
   1\.

   ```
   <figure><img src="/files/myb8q22WkR1XkBa3pHzh" alt=""><figcaption></figcaption></figure>
   ```

7. Close the window and view the installed ISO file

## Enable Nested Virtualization

The below one-liner script works as follows:

1. **Detect CPU Vendor:**\
   It uses the `lscpu` command to check if the CPU is Intel (`GenuineIntel`) or AMD (`AuthenticAMD`).
2. **Configure Nested Virtualization:**
   * For Intel CPUs, it writes the line `options kvm-intel nested=Y` to `/etc/modprobe.d/kvm-intel.conf` to enable nested virtualization.
   * For AMD CPUs, it writes `options kvm-amd nested=1` to `/etc/modprobe.d/kvm-amd.conf` for the same purpose.
3. **Reload KVM Kernel Module:**\
   To apply changes immediately without reboot, the script unloads (`modprobe -r`) and reloads (`modprobe`) the respective kernel module:
   * `kvm_intel` for Intel CPUs
   * `kvm_amd` for AMD CPUs
4. **Print Confirmation:**\
   After reloading, it prints a label ("Intel Nested:" or "AMD Nested:") followed by the current state of the nested virtualization parameter by reading:
   * `/sys/module/kvm_intel/parameters/nested` for Intel
   * `/sys/module/kvm_amd/parameters/nested` for AMD
5. **Fallback for Unsupported CPUs:**\
   If the CPU is neither Intel nor AMD, it outputs "Unsupported CPU" to notify the user.

The script essentially automates the manual process of enabling nested virtualization on a Proxmox host, avoiding reboot by reloading the kernel modules, and immediately shows whether the feature is enabled (expecting a `Y` or `1`). This makes it easier and faster to set up nested virtualization in Proxmox environments using either Intel or AMD processors.

ENSURE THAT ALL VMs ARE STOPPED or you will receive this error based on your CPU :

`modprobe: FATAL: Module kvm_intel is in use.`

{% code overflow="wrap" %}

```bash
if [[ $(lscpu | grep -o 'GenuineIntel') ]]; then echo "options kvm-intel nested=Y" > /etc/modprobe.d/kvm-intel.conf && modprobe -r kvm_intel && modprobe kvm_intel && echo -n "Intel Nested: " && cat /sys/module/kvm_intel/parameters/nested; elif [[ $(lscpu | grep -o 'AuthenticAMD') ]]; then echo "options kvm-amd nested=1" > /etc/modprobe.d/kvm-amd.conf && modprobe -r kvm_amd && modprobe kvm_amd && echo -n "AMD Nested: " && cat /sys/module/kvm_amd/parameters/nested; else echo "Unsupported CPU"; fi
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://martian1337.gitbook.io/notes/digital-privacy/self-hosting/proxmox-ve.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
