This commit is contained in:
Mike McFetridge
2026-07-20 09:23:17 -04:00
parent c1315882da
commit 72272e4006
3179 changed files with 562960 additions and 14 deletions
@@ -0,0 +1,122 @@
---
tags:
- Proxmox
- Backup
---
# Backup and Restore Procedures for Proxmox VE
As someone who values resilience and efficiency in managing virtualized environments, Ive found Proxmox VE to be a fantastic tool for ensuring data integrity and quick recovery. Its backup and restore system is comprehensive, offering features that meet both personal and professional needs. Whether you're managing a home lab (like mine!) or an enterprise setup, Proxmox has you covered.
---
## **Backup Overview**
Proxmoxs backup system is designed with flexibility and efficiency in mind, allowing you to create both **full** and **incremental backups** for virtual machines (VMs) and containers. Heres what makes it so powerful:
### **Backup Types**
1. **Full Backup**:
- Captures an entire snapshot of a VM or container, including all its configuration and disk data.
- Ideal for the first backup or periodic full backups to maintain a complete data baseline.
- I use full backups when Im making significant changes to my Proxmox setup or upgrading software on critical VMs.
2. **Incremental Backup**:
- Only stores the differences (changes) since the last backup.
- Saves time and storage space, making it great for frequent backups of dynamic systems.
- I rely on incremental backups for my Plex server and other services that experience frequent but minor updates.
### **Backup Storage Options**
Proxmox supports multiple storage backends, so you can tailor backups to your environment:
- **Local Storage**:
- Convenient for small setups or non-critical data.
- For example, I use a dedicated disk on my Dell PowerEdge server for quick local backups.
- **Network Storage (NAS)**:
- Perfect for storing backups off the main server.
- I utilize my Synology NAS with RAID 5 for storing backups securely while ensuring redundancy.
- **Proxmox Backup Server (PBS)**:
- This is a game-changer! It offers deduplication, encryption, and efficient backup storage.
- I integrated PBS into my lab to centralize all my backups and reduce storage usage with deduplication.
### **Compression and Encryption**
1. **Compression**:
- Proxmox supports several compression options:
- **Zstandard (zstd)**: My go-to for balancing speed and compression efficiency.
- **Gzip**: Slower but highly compressed files.
- **LZO**: Faster but less compression.
- I prefer zstd because its quick and doesnt eat up CPU resources on my PowerEdge.
2. **Encryption**:
- Essential when storing backups remotely or on shared storage.
- With PBS, I can encrypt backups, giving me peace of mind that my data is secure.
### **Backup Scheduling**
One of my favorite Proxmox features is its integrated task scheduler:
- **Set It and Forget It**: Automate backups daily, weekly, or monthly.
- For example, I schedule daily incremental backups for my critical VMs (like Pi-hole and Nextcloud) and weekly full backups for larger systems, ensuring Im always protected.
---
## **Restore Functionality**
Proxmoxs restore system is designed for quick and easy recovery, minimizing downtime in the event of a failure.
### **Restore Options**
1. **Full VM/Container Restore**:
- Quickly recover the entire VM or container to its last backed-up state.
- I tested this extensively when experimenting with GPU passthrough on my Proxmox setup. Restoring from a backup saved me after a configuration mishap.
2. **Selective Restore (with PBS)**:
- Allows restoring specific files or data from a backup.
- For example, if I mess up a config file on my web server, I can restore just that file instead of the entire VM.
3. **Snapshot Integration**:
- If you're using ZFS or Ceph storage, Proxmox can leverage snapshots for fast, consistent backups and restores.
- Ive set up ZFS pools in my environment, and snapshots make rollback super efficient.
---
## **Why Backups Are Critical**
Ive learned through trial and error that backups are essential, even in a home lab. From unexpected hardware failures to botched configurations, having reliable backups ensures I can recover quickly without losing progress.
---
## **Best Practices**
Here are some tips Ive implemented in my setup to ensure my backups are always reliable:
1. **Develop a Strategy**:
- Mix full and incremental backups to balance storage use and recovery times.
- I follow the **3-2-1 rule**: 3 copies of my data, 2 different storage locations, and 1 offsite backup.
2. **Test Your Restores**:
- Dont assume backups work—test them!
- I schedule quarterly tests by restoring random VMs to verify data integrity.
3. **Use Proxmox Backup Server**:
- If youre serious about backups, PBS is worth it. Deduplication has saved me tons of storage space.
4. **Offsite Backup**:
- For disaster recovery, I replicate critical backups to a cloud service or external NAS. This adds another layer of protection.
5. **Document Your Setup**:
- I maintain a detailed document of my backup schedule, locations, and restore procedures. This helps me troubleshoot or onboard others to my setup if needed.
---
## **Real-World Example: My Experience**
A few months ago, I made some network changes to my Proxmox server while reconfiguring VLANs. I accidentally locked myself out of a VM that hosted a crucial web service. Thanks to Proxmoxs restore functionality, I was able to roll back to a working state in under 10 minutes. That moment reinforced the importance of regular backups and why Ive gone all-in with Proxmoxs system.
@@ -0,0 +1,85 @@
---
tags:
- Proxmox
- Containers
- LXC
---
# **Linux Containers (LXC) in Proxmox**
## **Overview**
Linux Containers (LXC) provide a lightweight and efficient way to virtualize workloads on a single host. In Proxmox, LXC is seamlessly integrated, offering a streamlined container management experience alongside full virtual machines. Containers are an excellent choice for tasks that dont require the overhead of a full VM, making them an invaluable tool for homelab setups—even if, like me, you use them occasionally for testing or lightweight workloads.
This page provides an overview of LXC in Proxmox, personal insights from my own experience, and links to detailed guides for common container-related tasks. While my primary focus remains on VMs for most of my homelab services, Ive found LXC containers to be an ideal solution for trying out new applications or handling lightweight processes.
---
## **What Are LXC Containers?**
LXC containers are operating-system-level virtualization units that run isolated processes on the host system, sharing its kernel. Unlike traditional VMs that emulate hardware and run their own kernel, containers are far more resource-efficient while still offering a high degree of isolation.
In Proxmox, LXC is fully integrated into the platform, allowing users to create, manage, and optimize containers via its intuitive web interface or command-line tools.
---
## **Why (and When) Use Containers in a Homelab?**
Containers excel in situations where lightweight, scalable, and resource-efficient solutions are needed. Common scenarios include:
- **Testing new applications**: Avoid the overhead of spinning up a full VM.
- **Running microservices**: Perfect for modular workloads that dont require full VM isolation.
- **Lightweight workloads**: Ideal for tasks like DNS caching (e.g., Pi-hole), simple web servers, or sandboxed development environments.
In my homelab, I primarily use containers for experimentation. While my production services run on VMs, LXC containers allow me to quickly try new applications or concepts without significant resource commitments.
---
## **Key Features of LXC in Proxmox**
### **1. Lightweight Virtualization**
- Containers share the host kernel, drastically reducing memory and CPU usage compared to VMs.
- Ideal for resource-constrained environments or hardware with limited specs.
### **2. Simplified Resource Management**
- Proxmox provides fine-grained control over container resources, such as CPU, memory, and storage quotas.
- Efficiently manage and allocate resources to maximize performance.
### **3. Snapshots and Cloning**
- **Snapshots**: Create quick backups of containers, making it easy to roll back changes.
- **Clones**: Replicate container configurations with ease, saving time on repetitive setups.
### **4. Integrated Management Tools**
- Manage LXC containers through Proxmoxs web-based UI or CLI for an intuitive, user-friendly experience.
---
## **Links to Further Guides**
1. **[Setting Up Containers for Lightweight Workloads](https://wiki.kitpro.us/en/server/lxc/setting-up-containers)**
Step-by-step instructions for creating and configuring LXC containers in Proxmox.
2. **[Managing Container Lifecycle](https://wiki.kitpro.us/en/server/lxc/managing-container-lifecycle)**
Learn how to handle snapshots, backups, cloning, and deleting containers efficiently.
3. **[Container-Specific Use Cases and Optimizations](https://wiki.kitpro.us/en/server/lxc/container-specific-uses)**
Explore best practices for container tuning, security enhancements, and specific workload scenarios.
---
## **My Personal Take on LXC in the Homelab**
While I dont heavily rely on LXC containers for my primary homelab services, theyve proven invaluable for quick testing and prototyping. For example:
- Before committing to a full VM for **Nextcloud**, I used a container to evaluate its features with minimal setup.
- Containers have also been handy for exploring DNS services or hosting lightweight web apps without affecting my primary infrastructure.
For anyone building or expanding a homelab, experimenting with LXC containers can open new possibilities. Theyre fast, resource-efficient, and easy to manage—especially with Proxmoxs robust toolset. Whether youre running low-spec hardware or exploring new technologies, containers are a versatile addition to any homelab workflow.
---
Feel free to explore the guides linked above to dive deeper into setting up and managing LXC containers in Proxmox. Start small, experiment, and unlock the potential of lightweight virtualization!
+72
View File
@@ -0,0 +1,72 @@
---
tags:
- Proxmox
- Mount
---
Detailed Steps:
1. **Connect and Identify the USB Drive:**
- Plug the USB drive into your Proxmox server.
- Use the `lsblk` command to list block devices and identify the correct device name (e.g., `/dev/sdb1`, `/dev/sdc1`). Pay attention to the size to ensure you've selected the correct drive. 
Code
```
lsblk
```
1. **Format the USB Drive:**
- Use the appropriate command to format the drive with a suitable filesystem. For backups, `ext4` is a good choice. 
Code
```
mkfs.ext4 /dev/sdX1
```
- Replace `/dev/sdX1` with the actual device name you identified. 
- **Note:** If you are using the drive for Windows VMs, you might need to format it with NTFS. 
1. **Create a Mount Point:**
- Create a directory where you want to mount the USB drive. 
Code
```
mkdir /mnt/usb_storage
```
1. **Mount the USB Drive:**
- Mount the formatted drive to the created mount point. 
Code
```
mount /dev/sdX1 /mnt/usb_storage
```
1. **Configure Automatic Mounting:**
- Edit the `/etc/fstab` file to ensure the drive is automatically mounted after a reboot. 
Code
```
nano /etc/fstab
```
- Add a line similar to the following, replacing the UUID, mount point, and filesystem type as needed: 
Code
```
UUID=your_uuid /mnt/usb_storage ext4 defaults,noatime,nofail 0 2
```
- To find the UUID, use `lsblk -o +UUID as root`. 
- **Note:** The `nofail` option prevents the system from failing to boot if the drive is not available. 
1. **Add as Proxmox Storage (Optional):**
- In the Proxmox web interface, navigate to Datacenter > Storage. 
- Click "Add" and select "Directory". 
- Configure the storage ID, directory (mount point), and filesystem type (e.g., `ext4`). 
- You can then use this storage for backups or other purposes.
@@ -0,0 +1,113 @@
---
tags:
- Proxmox
- Networking
---
# Networking Configuration in Proxmox
Proxmox supports robust and advanced networking setups, providing flexibility and scalability for your home lab or enterprise environment. Whether youre isolating VLANs, setting up bridges for inter-VM communication, or configuring network bonding for redundancy, Proxmox makes networking powerful yet manageable.
For my personal setup, Ive taken full advantage of Proxmox's networking features to create a segmented network with multiple VLANs, ensuring isolation for devices like IoT, my home lab, and general usage. This approach has significantly improved both security and organization within my network.
---
## Isolated VLANs for Better Network Organization
One of the standout features of Proxmox is its ability to support VLANs (Virtual Local Area Networks). VLANs are a game-changer in organizing network traffic:
- **Benefits**:
- Improved security by isolating traffic between devices or groups of devices.
- Reduced broadcast domain size, leading to better network performance.
- Simplified troubleshooting as each VLAN has its own subnet.
### My Use Case:
In my home lab, I have VLANs set up for:
- **Main LAN**: All trusted devices, including workstations and my server.
- **IoT Network**: Devices like smart TVs, cameras, and other IoT gear.
- **Homelab Network**: Dedicated to virtual machines and services I host, such as Pi-hole, Plex, and Nextcloud.
Each VLAN has its own unique subnet, configured through pfSense, my primary firewall. This ensures that traffic is isolated unless explicitly allowed via firewall rules. For example, IoT devices can only access the internet but not other networks.
---
## Bridges for Inter-VM Communication
In Proxmox, bridges are used to connect virtual machines (VMs) to the same network or VLAN as the physical host.
- **How it Works**:
- Each bridge acts as a virtual switch, allowing VMs to share the same network interface card (NIC) of the Proxmox host.
- You can assign VMs to specific bridges to isolate traffic or enable communication between them.
### My Setup:
For most VMs, I use a dedicated bridge corresponding to the VLAN they belong to. This ensures that VMs respect the same segmentation as physical devices on the network.
Example:
```bash
auto vmbr10
iface vmbr10 inet manual
bridge_ports none
bridge_stp off
bridge_fd 0
vlan-raw-device enp3s0
```
In this setup:
- `vmbr10` is the bridge assigned to VLAN 10 (my homelab network).
- `vlan-raw-device` links the bridge to a specific physical NIC for VLAN tagging.
---
## Network Bonding for Redundancy and Throughput
Proxmox supports **network bonding**, which allows you to combine multiple physical NICs into a single interface. This is especially useful in scenarios where high availability or increased throughput is critical.
- **Modes**:
- Active-Backup (Mode 1): Provides redundancy; only one NIC is active at a time.
- Balance-TLB (Mode 5): Balances outgoing traffic across NICs.
- LACP (Mode 4): Aggregates NICs to increase throughput when supported by the switch.
### My Setup:
On my Proxmox host, Ive configured network bonding to ensure reliability:
```bash
auto bond0
iface bond0 inet manual
bond-slaves enp1s0 enp2s0
bond-mode 4
bond-miimon 100
auto vmbr0
iface vmbr0 inet static
address 10.10.1.2/24
gateway 10.10.1.1
bridge-ports bond0
bridge-stp off
bridge-fd 0
```
Heres whats happening:
- Two physical NICs (`enp1s0` and `enp2s0`) are bonded for increased throughput and failover.
- The bonded interface is linked to a bridge (`vmbr0`) for traffic routing.
This ensures that even if one NIC fails, the other seamlessly takes over, keeping my VMs and services accessible.
---
## Final Thoughts
Building a robust network with Proxmox has been both a technical challenge and a rewarding experience. By using VLANs, bridges, and network bonding, Ive optimized my setup for performance, security, and scalability. Whether you're just starting with Proxmox or refining an existing network, these features provide incredible flexibility.
If youre interested in taking your networking setup to the next level, I recommend:
1. Planning your VLAN structure based on your device and traffic needs.
2. Exploring Proxmoxs built-in tools for creating and managing bridges.
3. Implementing network bonding if you have multiple NICs to ensure uptime and boost throughput.
Feel free to reach out if you want to dive deeper into any of these configurations!
@@ -0,0 +1,133 @@
---
tags:
- Proxmox
- Containers
---
# Container-Specific Use Cases and Optimizations
Linux Containers (LXC) in Proxmox provide a flexible and efficient way to run lightweight workloads in a homelab or production environment. While their resource efficiency is a key benefit, their versatility allows them to excel in a variety of specific use cases. This page explores common container applications and offers tips to optimize their performance and security.
---
## Common Use Cases for Containers
### 1. **Lightweight Web Servers**
LXC containers are ideal for hosting lightweight web servers such as:
- **Nginx**: For reverse proxies or static file hosting.
- **Apache**: For small-scale web applications.
**Why Containers?**
- Fast deployment and minimal resource usage.
- Easy to clone or migrate for scaling or testing.
### 2. **Development Environments**
Containers are perfect for setting up isolated development environments, enabling you to:
- Test applications without polluting your main system.
- Quickly spin up environments for specific programming languages or frameworks.
**Example**: A Python-based development container with all dependencies pre-installed for a project.
### 3. **DNS and Caching Services**
Services like Pi-hole can run efficiently in a containerized environment:
- Provides network-wide ad-blocking and DNS resolution.
- Lightweight resource footprint makes containers an ideal choice.
### 4. **Testing and Experimentation**
Containers provide a sandboxed environment for:
- Trying out new software or updates.
- Learning and experimenting with configurations before applying them to production.
### 5. **Microservices Architecture**
Containers align well with the microservices model:
- Deploy and manage individual services (e.g., databases, APIs).
- Scale individual components independently.
---
## Optimizations for Container Performance
To get the most out of your containers, consider the following optimizations:
### 1. **Resource Allocation**
- Assign appropriate CPU and memory limits to prevent overloading the host.
```bash
pct set <container-id> -cpu 2 -memory 1024
```
- Use storage quotas to ensure containers do not consume excessive disk space.
### 2. **Networking Configuration**
- Use bridged networking (`vmbr0`) for containers requiring direct LAN access.
- Isolate containers with VLANs for better security and traffic control.
### 3. **Use Templates for Faster Deployments**
- Create custom templates for frequently used configurations.
- Save time and maintain consistency across deployments.
### 4. **Regular Backups**
- Schedule backups using Proxmoxs backup tool.
```bash
vzdump <container-id> --storage <storage-name>
```
- Keep backups on external or redundant storage to prevent data loss.
### 5. **Snapshots for Quick Recovery**
- Take snapshots before major changes or updates to quickly revert if needed.
```bash
pct snapshot <container-id> <snapshot-name>
```
### 6. **Security Hardening**
- Limit container access to critical network services.
- Use read-only mounts where possible to prevent accidental modifications.
```bash
pct set <container-id> -mp0 /data,mp=/data,ro=1
```
---
## Security Considerations
While LXC containers are lightweight, they share the host kernel, making security a critical factor. Implement the following best practices:
- **Isolate Sensitive Containers**: Use dedicated networks or VLANs.
- **Monitor Resource Usage**: Regularly check for unusual CPU, memory, or network activity.
- **Keep Templates and Images Updated**: Ensure that base templates are patched against vulnerabilities.
- **Disable Unnecessary Privileges**: Use unprivileged containers whenever possible.
```bash
pct create <container-id> local:vztmpl/ubuntu-20.04-standard_20.04-1_amd64.tar.gz -unprivileged 1
```
---
## Final Thoughts
LXC containers in Proxmox offer incredible flexibility and performance for a variety of use cases. From lightweight web servers to complex development environments, they can adapt to meet your needs. By following the optimizations and security practices outlined here, you can ensure that your containers remain efficient, secure, and reliable.
Ready to dive deeper? Check out related guides on **[Managing Container Lifecycle](https://wiki.kitpro.us/en/server/lxc/container-specific-uses#)** and **[Setting Up Containers for Lightweight Workloads](https://wiki.kitpro.us/en/server/lxc/container-specific-uses#)**.
@@ -0,0 +1,156 @@
---
tags:
- Proxmox
- Containers
---
# Managing Container Lifecycle in Proxmox
Managing the lifecycle of LXC containers in Proxmox is a crucial aspect of maintaining a stable, efficient, and optimized homelab. LXC containers are lightweight virtualization units that share the hosts kernel while maintaining process isolation, making them an excellent choice for resource-efficient workloads and testing environments. Proxmox provides powerful tools to manage the entire lifecycle of containers, from creation to deletion, with features like snapshots, cloning, backups, and migrations.
This guide provides a comprehensive overview of managing containers effectively, ensuring you get the most out of your lightweight virtualization environment.
---
## Container Lifecycle Stages
### 1. **Creating Containers**
The starting point for any container lifecycle is its creation. Using the Proxmox interface or CLI, you can:
- Select templates appropriate for your workload.
- Configure resources like CPU, memory, and storage.
- Set up network options to integrate the container into your environment.
---
### 2. **Starting and Stopping Containers**
Containers in Proxmox can be easily started or stopped based on your needs:
- **Start**: Boots the container, making it accessible.
- **Stop**: Gracefully shuts down the container.
- **Reboot**: Restarts the container for changes to take effect.
These actions can be performed via the Proxmox GUI or CLI:
```bash
pct start <container-id>
pct stop <container-id>
pct reboot <container-id>
```
---
### 3. **Snapshots**
Snapshots are a powerful tool for capturing the state of a container at a specific moment. For example, Ive used snapshots to test significant updates to services like a development environment. If an update causes unexpected issues, restoring the snapshot allows me to quickly return to a functional state without starting over. This is especially useful for testing changes or updates. To create a snapshot:
1. Go to the containers settings in the Proxmox GUI.
2. Navigate to the **Snapshots** tab.
3. Click **Take Snapshot** and provide a name.
Snapshots can also be managed via the CLI:
```bash
pct snapshot <container-id> <snapshot-name>
```
**Restoring a Snapshot**:
If something goes wrong, you can quickly restore the container to a previous state:
```bash
pct restore <container-id> <snapshot-name>
```
---
### 4. **Cloning Containers**
Cloning allows you to duplicate a container, which is useful for replicating configurations or creating similar environments quickly. For example, Ive found cloning particularly helpful when testing updates to services like Nextcloud. I can clone the container, apply the updates to the clone, and verify everything works before rolling out changes to my main environment. Proxmox offers two cloning options:
- **Full Clone**: Creates an independent copy of the container.
- **Linked Clone**: Shares the base image with the original container, saving storage space.
To clone a container in the GUI:
1. Right-click on the container.
2. Select **Clone**.
3. Choose between full or linked clone.
From the CLI:
```bash
pct clone <container-id> <new-container-id>
```
---
### 5. **Backing Up Containers**
Regular backups are essential for disaster recovery. To choose the right backup schedule, consider the container's purpose and how critical its data is. For example, daily backups are ideal for frequently updated services, while weekly backups may suffice for less active containers. You can find more guidance on backup strategies in [Proxmox Backup Best Practices](https://wiki.kitpro.us/server/proxmox/proxmox-backup-restore). Proxmox supports scheduled and manual backups:
1. Go to **Datacenter > Backup** in the GUI.
2. Create a new backup job, specifying the container, schedule, and storage location.
Manual backup via CLI:
```bash
vzdump <container-id> --storage <storage-name>
```
**Restoring Backups**:
If needed, you can restore backups to the same or a different Proxmox host:
```bash
vzrestore <backup-file> <new-container-id>
```
---
### 6. **Migrating Containers**
Proxmox makes it easy to move containers between nodes in a cluster. This is helpful for load balancing or hardware upgrades. To migrate a container:
1. Right-click on the container in the GUI.
2. Select **Migrate** and choose the target node.
CLI command:
```bash
pct migrate <container-id> <target-node>
```
---
### 7. **Deleting Containers**
When a container is no longer needed, it can be safely deleted:
1. Stop the container if its running.
2. Right-click on the container in the GUI and select **Remove**.
CLI command:
```bash
pct stop <container-id>
pct destroy <container-id>
```
---
## Best Practices for Lifecycle Management
1. **Use Snapshots Before Major Changes**: Always snapshot a container before applying updates or configurations.
2. **Automate Backups**: Set up regular backup jobs to ensure you can recover from unexpected failures.
3. **Monitor Resource Usage**: Periodically review resource allocation to optimize container performance.
4. **Document Configurations**: Keep track of settings and changes to simplify troubleshooting or replication.
---
## Final Thoughts
Managing the lifecycle of LXC containers in Proxmox is straightforward with the platforms robust tools, such as its intuitive GUI for creating, starting, and stopping containers, the ability to manage snapshots and backups with a few clicks, and powerful CLI commands that provide advanced control over container operations. By taking advantage of snapshots, backups, and migration capabilities, you can ensure that your containers are flexible, reliable, and easy to manage. While I mostly use containers for testing, the lifecycle tools make it easy to experiment without fear of losing progress or data.
For more details on container use cases and optimizations, see **[Container-Specific Use Cases and Optimizations](https://wiki.kitpro.us/en/server/lxc/container-specific-uses)**.
@@ -0,0 +1,108 @@
---
tags:
- Proxmox
- Containers
---
# Setting Up Containers for Lightweight Workloads
Linux Containers (LXC) are a powerful feature in Proxmox, allowing you to run lightweight, resource-efficient workloads with minimal setup. Whether youre hosting a small web server, testing a new application, or setting up a DNS service, LXC containers are a great way to get started quickly without the overhead of a full virtual machine.
In this guide, Ill walk you through the process of setting up LXC containers in Proxmox and share tips to optimize them for lightweight workloads. Even though I primarily use containers for testing in my homelab, theyve proven invaluable for quick experiments and resource-efficient deployments.
---
## Prerequisites
Before setting up an LXC container, make sure you have:
1. **Proxmox VE Installed**: Ensure your Proxmox host is up and running.
2. **Storage Configured**: Define storage locations for container images and data.
3. **Templates Available**: Download LXC templates via the Proxmox interface.
---
## Step-by-Step Setup
### Step 1: Download an LXC Template
1. Log in to the Proxmox web interface.
2. Navigate to **`Datacenter > Storage`** and select the storage youve designated for containers.
3. Click **Templates**, then browse the list of available templates (e.g., Ubuntu, Debian, Alpine).
4. Select a template suitable for your workload and click **Download**.
### Step 2: Create a New LXC Container
1. In the Proxmox web interface, navigate to **`Create CT`** (short for Create Container).
2. Fill out the following details:
- **Node**: Select the Proxmox host.
- **Hostname**: Enter a name for the container (e.g., `lightweight-app`).
- **Password**: Set a strong root password for the container.
3. Choose the **template** you downloaded in Step 1.
### Step 3: Configure Resources
Assign resources to the container:
- **CPU**: Specify the number of cores (e.g., 1 or 2 for lightweight workloads).
- **Memory**: Allocate sufficient RAM (e.g., 512 MB or 1 GB).
- **Disk Space**: Define the disk size (e.g., 8 GB).
These settings ensure the container remains lightweight while providing enough capacity for the workload.
### Step 4: Network Configuration
1. Select the **network bridge** (e.g., `vmbr0`) for the container.
2. Assign an IP address. You can:
- Use DHCP to automatically get an IP from your network.
- Assign a static IP for more control.
3. Set the DNS server, if needed (e.g., your Pi-hole instance).
### Step 5: Finalize and Start
1. Review your settings in the summary screen.
2. Click **Finish** to create the container.
3. Once created, start the container and access its console to verify functionality.
---
## Post-Setup Configuration
### Install Required Packages
Use your containers package manager (e.g., `apt`, `apk`, or `yum`) to install necessary software. For example, if youre setting up a web server:
```bash
apt update && apt install nginx -y
```
### Optimize for Lightweight Workloads
- **Resource Limits**: Adjust CPU and memory limits via the Proxmox interface if needed.
- **Reduce Startup Services**: Disable unnecessary services within the container to save resources.
- **Backups**: Schedule regular backups using Proxmoxs built-in tools.
---
## Example Use Case: Hosting a Simple Web Server
1. Create a container using an Ubuntu template.
2. Install Nginx with:
```bash
apt update && apt install nginx -y
```
3. Start Nginx and verify its running:
```bash
systemctl start nginx
systemctl enable nginx
```
4. Access the containers IP in your browser to see the default Nginx page.
---
## Final Thoughts
Setting up LXC containers in Proxmox is straightforward and efficient, making them ideal for lightweight workloads. While I mostly use containers for testing in my homelab, theyve consistently proven their value for quick, low-resource deployments. If youre just getting started, try creating a small container to explore its capabilities—you might find its the perfect fit for more than just testing!
@@ -0,0 +1,160 @@
---
tags:
- Proxmox
- Cheetsheet
---
VM Management
-------------
| Command | Command Description |
| --- | --- |
| `qm list` | list VMs |
| `qm create <vm>` | Create or restore a virtual machine. |
| `qm start <vm>` | Start a VM |
| `qm suspend <vm>` | Suspend virtual machine. |
| `qm shutdown <vm>` | Shutdown a VM |
| `qm reboot <vm>` | Reboot a VM |
| `qm reset <vm>` | Reset a VM |
| `qm stop <vm>` | Stop a VM |
| `qm destroy <vm>` | Destroy the VM and all used/owned volumes. |
| `qm monitor <vm>` | Enter Qemu Monitor interface. |
| `qm pending <vm>` | Get the virtual machine configuration with both current and pending values. |
| `qm sendkey <vm> <key_event>` | Send key event to virtual machine. |
| `qm showcmd <vm>` | Show command line used to start the VM (debug info). |
| `qm unlock <vm>` | Unlock the VM |
| `qm clone <vm> <new_vm>` | Clone a VM |
| `qm migrate <vm> <node>` | Migrate a VM |
| `qm status <vm>` | Show VM status |
| `qm template <vm>` | Create a Template |
| `qm set <vm>` | Set virtual machine options (synchronous API) |
### Cloudinit
| Command | Command Description |
| --- | --- |
| `qm cloudinit dump <vm> <type>` | Get automatically generated cloudinit config. |
| `qm cloudinit pending <vm>` | Get the cloudinit configuration with both current and pending values. |
| `qm cloudinit update <vm>` | Regenerate and change cloudinit config drive. |
### Disk
| Command | Command Description |
| --- | --- |
| `qm disk import <vm> <source> <storage` | Import an external disk image as an unused disk in a VM. |
| `qm disk move <vm> <disk>` | Move volume to different storage or to a different VM. |
| `qm disk rescan` | Rescan all storages and update disk sizes and unused disk images. |
| `qm disk resize <vm> <disk> <size>` | Extend volume size. |
| `qm disk unlink <vm> --IDLIST <string>` | Unlink/delete disk images. |
| `qm rescan` | Rescan volumes. |
| `qemu-img convert <qcow2> <raw>` | Convert qcow2 to raw |
| `qemu-img convert -p -O qcow2 <raw> <qcow2>` | Convert back to qcow2 |
### Snapshot
| Command | Command Description |
| --- | --- |
| `qm listsnapshot <vm>` | List all snapshots. |
| `qm snapshot <vm> <snapshot>` | Snapshot a VM. |
| `qm delsnapshot <vm> <snapshot>` | Delete a snapshot. |
| `qm rollback <vm> <snapshot>` | Rollback a snapshot. |
| `qm terminal <vm>` | Open a terminal using a serial device. |
| `qm vncproxy <vm>` | Proxy VM VNC traffic to stdin/stdout. |
### Misc
| Command | Command Description |
| --- | --- |
| `qm guest cmd <vm> <command>` | Execute Qemu Guest Agent commands. |
| `qm guest exec <vm>` | Executes the given command via the guest agent. |
| `qm guest exec-status <vm> <pid>` | Gets the status of the given pid started by the guest-agent. |
| `qm guest passwd <vm> <user>` | Sets the password for the given user to the given password. |
### PV, VG, LV Management
| Command | Command Description |
| --- | --- |
| `pvcreate <disk>` | Create a PV |
| `pvremove <disk>` | Remove a PV |
| `pvs` | List all PVs |
| `vgcreate <vg> <disk>` | Create a VG |
| `vgremove <vg>` | Remove a VG |
| `vgs` | List all VGs |
| `lvcreate -L LV-SIZE -n <lv> <vg>` | Create a LV |
| `lvremove <vg>/<lv>` | Remove a LV |
| `lvs` | List all LVs |
### Storage Management
| Command | Command Description |
| --- | --- |
| `pvesm add TYPE <storage>` | Create a new storage |
| `pvesm alloc <storage> <vm> <file> <size>` | Allocate disk images |
| `pvesm free <volume>` | Delete volume |
| `pvesm remove <storage>` | Delete storage configuration |
| `pvesm list <storage>` | List storage content |
| `pvesm lvmscan` | An alias for pvesm scan lvm |
| `pvesm lvmthinscan` | An alias for pvesm scan lvmthin |
| `pvesm scan lvm` | List local LVM volume groups |
| `pvesm scan lvmthin VG` | List local LVM Thin Pools |
| `pvesm status` | Get status for all datastores |
### Template Management
| Command | Command Description |
| --- | --- |
| `pveam available` | List all templates |
| `pveam list <storage>` | List all templates |
| `pveam download <storage> <template>` | Download appliance templates |
| `pveam remove <template>` | Remove a template |
| `pveam update` | Update Container Template Database |
Container Management
--------------------
| Command | Command Description |
| --- | --- |
| `pct list` | List containers |
| `pct create <vm> OSTEMPLATE` | Create or restore a container |
| `pct start <vm>` | Start the container |
| `pct clone <vm> <new_vm>` | Create a container clone/copy |
| `pct suspend <vm>` | Suspend the container. This is experimental. |
| `pct resume <vm>` | Resume the container |
| `pct stop <vm>` | Stop the container. This will abruptly stop all processes running in the container. |
| `pct shutdown <vm>` | Shutdown the container. This will trigger a clean shutdown of the container. |
| `pct destroy <vm>` | Destroy the container (also delete all uses files) |
| `pct status <vm>` | Show CT status |
| `pct migrate <vm> <target>` | Migrate the container to another node. Creates a new migration task. |
| `pct config <vm>` | Get container configuration |
| `pct cpusets` | Print the list of assigned CPU sets |
| `pct pending <vm>` | Get container configuration, including pending changes |
| `pct reboot <vm>` | Reboot the container by shutting it down and starting it again. Applies pending changes. |
| `pct restore <vm> <template>` | Create or restore a container |
| `pct set <vm>` | Set container options |
| `pct template <vm>` | Create a Template |
| `pct unlock <vm>` | Unlock the VM |
### Container Disks
| Command | Command Description |
| --- | --- |
| `pct df <vm>` | Get the containers current disk usage |
| `pct fsck <vm>` | Run a filesystem check (fsck) on a container volume |
| `pct fstrim <vm>` | Run fstrim on a chosen CT and its mountpoints |
| `pct mount <vm>` | Mount the containers filesystem on the host |
| `pct move-volume <vm> <volume>` | Move a rootfs-/mp-volume to a different storage or to a different container |
| `pct unmount <vm>` | Unmount the containers filesystem |
| `pct resize <vm> <disk> <size>` | Resize a container mount point |
| `pct rescan` | Rescan all storages and update disk sizes and unused disk images |
| `pct enter <vm>` | Connect to container |
| `pct console <vm>` | Launch a console for the specified container |
| `pct exec <vm>` | Launch a command inside the specified container |
| `pct pull <vm> <source> <destination>` | Copy a file from the container to the local system |
| `pct push <vm> <source> <destination>` | Copy a local file to the container |
Web GUI
-------
| Command | Command Description |
| --- | --- |
| `service pveproxy restart` | Restart the Proxmox web GUI |
@@ -0,0 +1,120 @@
---
tags:
- Proxmox
---
# Proxmox Initial Setup and Configuration
As a tech enthusiast and content creator with a passion for Linux, Proxmox Virtual Environment (VE) has been a game-changer in my home lab. It's a robust, open-source platform that has allowed me to optimize my homelab and manage multiple virtual machines (VMs) and containers seamlessly. Whether you're building a small lab or running a production environment, Proxmox VE offers a powerful suite of tools to get the job done.
---
## **1. Installation of Proxmox VE**
When I first started using Proxmox VE, I was impressed by how straightforward the installation process was. Here's a breakdown:
### **Options for Installation**
- **Bare-Metal Hardware**: I recommend installing Proxmox VE directly on physical hardware for the best performance. In my lab, I use a Dell PowerEdge T140 and Protectli Vault to get the most out of my hardware resources.
- **Virtualized Environment**: Proxmox can also run on another hypervisor, like VMware or VirtualBox, if you just want to test the waters. However, this isnt ideal for production since it introduces unnecessary overhead.
### **Steps**
1. **Download the ISO**: Head to the [official Proxmox VE download page](https://www.proxmox.com/) and grab the latest ISO file.
2. **Create Bootable Media**: Use a tool like Rufus or Balena Etcher to write the ISO to a USB drive. I've found this to be the quickest way to create bootable media.
3. **Boot and Install**: Boot your server from the USB drive, and the Proxmox installer will walk you through the process. Dont forget to configure the storage settings based on your setup. I prefer using ZFS for its built-in redundancy and snapshot features.
---
## **2. Initial Configuration**
Proxmox VEs web interface makes the initial setup intuitive. However, there are some key areas to focus on:
### **Network Setup**
During installation, configure:
- **Static IP Address**: This ensures that the Proxmox host is always reachable on the same IP.
- **Hostname**: I like to use FQDNs like `proxmox.home.lab` for clarity in my network.
- **Gateway and DNS**: Double-check these settings for seamless connectivity. I rely on my Pi-hole instance for DNS.
### **Storage Configuration**
- **LVM**: Proxmox sets up Logical Volume Manager (LVM) by default, which is fine for most use cases.
- **ZFS**: If youre looking for advanced features like compression and snapshots, ZFS is the way to go. In my setup, ZFS handles my VM and container storage, ensuring data integrity.
---
## **3. Post-Installation Steps**
### **Accessing the Web Interface**
Once the Proxmox installation is complete:
1. Open your browser and navigate to `https://<Proxmox_IP>:8006`.
2. Log in using the root account and the password you set during installation.
I recommend bookmarking the web interface URL. It becomes your central hub for managing everything.
### **Repositories and Updates**
Proxmox provides several repositories:
- **Enterprise Repository**: Great for stable updates, but it requires a subscription.
- **No-Subscription Repository**: Ideal for homelabbers like me who are using Proxmox without a paid plan. Add it with:
```bash
echo "deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list
apt update && apt dist-upgrade -y
```
### **Subscription Notice**
One of the first things I do is disable the subscription nag popup, which appears if youre using the no-subscription repository. The [Proxmox Helper Script](https://tteck.github.io/Proxmox/) makes this a breeze—more on that below.
---
## **4. Proxmox Helper Script: A Must-Have Tool**
One of the best discoveries I made after starting with Proxmox was the **Proxmox Helper Script** by TTeck. It simplifies so many tasks that used to take up my time.
### **Features of the Proxmox Helper Script**
- **LXC Container Automation**: Quickly set up containers for popular applications like Home Assistant, Pi-hole, and Jellyfin. I used it to deploy my Home Assistant instance, and it saved me hours.
- **System Tweaks**: Disable the subscription nag, optimize the Proxmox host, and even configure backups effortlessly.
- **Backup Management**: Schedule and manage VM/container backups with minimal effort.
### **Installing the Helper Script**
Run the following command in your Proxmox shell:
```bash
bash <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/pvehelperscript.sh)
```
### **What I Use It For**
- **Creating Containers**: Need a Pi-hole or Nextcloud container? This script makes it as simple as answering a few prompts.
- **System Optimization**: Tweaks like enabling advanced performance settings or customizing storage configurations are quick and easy.
### **Why Its Essential**
For anyone serious about Proxmox, this script is a no-brainer. It automates many repetitive tasks and ensures your system is configured optimally.
---
## **5. Pro Tips and Considerations**
- **Backups**: Always set up regular backups. Proxmoxs built-in backup system is robust and integrates seamlessly with external storage. I back up my VMs to a dedicated NAS.
- **Snapshots**: Snapshots are lifesavers during updates or major changes. I never update my Home Assistant instance without creating a snapshot first.
- **Firewall Rules**: Use Proxmoxs firewall to segment and secure your network. Ive configured mine to ensure only necessary traffic reaches my VMs and containers.
---
## **Why Proxmox?**
For me, Proxmox VE has been the backbone of my home lab. Whether it's hosting Plex for streaming, running a Minecraft server for my family, or testing new tools, Proxmox makes it all possible. The open-source nature of the platform aligns perfectly with my philosophy of empowering others to learn and build without breaking the bank.
---
With Proxmox VE and the Proxmox Helper Script, youre not just setting up a virtualization platform—youre building a system that grows with you. Whether you're a beginner or a seasoned pro, theres always something new to learn and improve. If you're curious about my setup or have any questions, feel free to check out my [YouTube channel, KeepItTechie](https://www.youtube.com/KeepItTechie), where I share tips, tricks, and tutorials on everything Linux and beyond.
@@ -0,0 +1,88 @@
---
tags:
- Proxmox
- Storage
---
# Storage Management
Managing storage effectively is crucial for a smooth and scalable home lab or enterprise setup. In my home lab, Ive implemented a combination of local and external storage solutions to ensure flexibility, scalability, and reliability. Heres a breakdown of some of the key considerations and tools Ive used or explored, with a focus on how they fit into my environment.
---
## **Local Storage Management**
### **ZFS: My Go-To for Local Storage**
ZFS (Zettabyte File System) is a powerhouse when it comes to local storage. In my setup, I use ZFS for its robust features like:
- **Data Integrity:** ZFS checksums every block of data to detect and correct errors, giving me peace of mind that my data is safe.
- **Snapshots:** The ability to take point-in-time snapshots is invaluable, especially when experimenting with my lab or rolling back after an update gone wrong.
- **Replication:** ZFS replication lets me efficiently back up datasets to other storage devices, which is great for disaster recovery.
For example, Ive set up ZFS on my **Dell PowerEdge T140**, leveraging its RAID capabilities and Xeon processor for a smooth experience. Its perfect for hosting VM images, Nextcloud data, and backups of my critical files.
#### **Why ZFS?**
I chose ZFS because its a battle-tested system with support for advanced features like:
- Compression to save disk space.
- Deduplication to optimize storage use.
- Integrated RAID (RAIDZ) without the need for additional hardware.
### **Extending with LVM**
For certain projects, Ive used Logical Volume Manager (LVM) to manage storage volumes. While not as feature-rich as ZFS, LVM provides the flexibility to resize volumes and manage partitions dynamically, which is handy for testing new configurations in my Proxmox environment.
---
## **External Storage Solutions**
### **NAS: The Backbone of My Network**
My **Synology NAS**, configured with 4 x 8TB WD Red drives in RAID 5, handles most of my large-scale storage needs. It integrates seamlessly with my home lab network and serves as a:
- Centralized file server.
- Backup destination for critical data.
- Media storage hub for Plex.
One of the key integrations in my setup is connecting the Synology NAS to **Proxmox**. This allows me to:
- Store backups of my Proxmox VMs directly on the NAS.
- Easily restore VMs if needed, thanks to the high-speed network connectivity.
- Leverage the NAS as a reliable and scalable storage solution without overloading the Proxmox servers local storage.
Ive set it up with multiple shared folders for different purposes, like lab backups, media files, and personal archives. Its all tied together with **Pi-hole DNS** and **pfSense DHCP** to keep things running smoothly.
### **Ceph for Scalable Storage**
While I havent implemented Ceph in my home lab yet, Ive done some testing with it. Ceph offers:
- **Scalability:** Perfect for expanding storage across multiple nodes.
- **Resilience:** Distributes data across the cluster, ensuring high availability.
- **Compatibility:** Works well with Proxmox, Kubernetes, and other platforms.
If I scale up my lab, Ceph would likely be my go-to solution for distributed storage.
---
## **Backup and Disaster Recovery**
### **Snapshots and Replication**
ZFS snapshots are part of my regular backup routine. I replicate critical datasets from my local ZFS pool to my NAS to ensure redundancy. Additionally, I leverage **Proxmoxs backup capabilities** to create snapshots of my VMs and store them on my Synology NAS.
### **Offsite Backups**
For offsite backups, Im exploring cloud-based solutions, but I also consider rotating external drives for a more hands-on approach.
---
## **Future Plans and Considerations**
As my home lab grows, Im looking into adding:
- **Hybrid Storage:** Combining NVMe drives for caching and spinning disks for bulk storage.
- **Cloud Integration:** Syncing certain datasets with cloud services for added redundancy.
- **Object Storage:** Exploring tools like MinIO for S3-compatible storage.
Managing storage isnt just about technology; its about designing a system that fits your needs and evolves with your goals. For me, its a mix of experimentation, learning, and adapting to new challenges. Whether youre just starting with local storage or diving into distributed systems like Ceph, theres always room to optimize and grow.
+102
View File
@@ -0,0 +1,102 @@
---
tags:
- Proxmox
---
# **Proxmox Overview**
## **What is Proxmox?**
Proxmox Virtual Environment (Proxmox VE) is a powerful, open-source server virtualization platform designed for private and public cloud infrastructure. It combines two robust virtualization technologies within a single, intuitive interface:
- **KVM (Kernel-based Virtual Machine)** for full virtualization.
- **LXC (Linux Containers)** for lightweight containerization.
Proxmox VE is renowned for its user-friendly web-based management interface, versatile feature set, and seamless integration with diverse storage and networking configurations. Its adaptability makes it an excellent choice for home labs, small-to-medium businesses, and enterprise-scale environments.
---
## **History of Proxmox**
- **Inception (2008):** Proxmox VE was developed by Proxmox Server Solutions GmbH to simplify virtualization management.
- **Evolution:** Initially a lightweight solution for managing virtual machines, Proxmox has evolved into a comprehensive virtualization platform, rivaling proprietary options like VMware and Hyper-V.
- **Open Source Commitment:** Proxmox is licensed under the GNU Affero General Public License (AGPL) and supported by an active global community, ensuring continual improvement and sustainability.
---
## **Key Features of Proxmox VE**
### **1. Virtualization Technologies**
- **KVM:** Full virtualization supporting a variety of guest operating systems.
- **LXC:** Efficient containerization for Linux-based workloads, minimizing overhead.
### **2. Web-Based Management Interface**
- Intuitive, browser-based dashboard for managing all aspects of your virtual environment.
### **3. High Availability (HA)**
- Cluster and failover tools ensure uptime for critical workloads.
### **4. Flexible Storage Options**
- Supports a range of storage configurations:
- Local storage (e.g., ZFS, EXT4).
- Network-attached storage (e.g., NFS, iSCSI, Ceph).
- Hybrid setups for redundancy and scalability.
### **5. Advanced Networking**
- VLANs, network bridges, and bonded interfaces for advanced setups.
- Network isolation and segmentation for enhanced security and performance.
### **6. Backup and Restore**
- Built-in backup and restore tools with support for scheduled snapshots and external storage.
### **7. Scalability**
- Scale across multiple nodes with cluster management and unified control.
### **8. Security**
- Features include two-factor authentication (2FA), role-based access control (RBAC), and encrypted communications.
---
## **Proxmox in Practice**
### **[Initial Setup and Configuration](https://wiki.kitpro.us/en/server/proxmox/setup-guide)**
- Install Proxmox VE on bare-metal hardware or within an existing virtualization platform.
- Configure networking, storage, and repositories during setup.
- Optional: Enable enterprise repositories for paid support.
### **[Networking Configuration](https://wiki.kitpro.us/en/server/proxmox/proxmox-networking-configuration)**
- Proxmox enables advanced networking setups like VLANs, bridges, and network bonding for redundancy and performance.
### **[Storage Management](https://wiki.kitpro.us/en/server/proxmox/proxmox-storage)**
- Manage local and external storage solutions, such as NAS or Ceph, for scalable and resilient storage.
- **ZFS** is a popular choice for its data integrity, snapshots, and replication capabilities.
### **[Backup and Restore Procedures](https://wiki.kitpro.us/en/server/proxmox/proxmox-backup-restore)**
- Create full or incremental backups for VMs and containers.
- Use built-in restore functionality for quick recovery from failures.
---
## **Useful Links**
- **Official Website:** [Proxmox VE](https://www.proxmox.com/en/proxmox-ve)
- **Documentation:** [Proxmox Docs](https://pve.proxmox.com/wiki/)
- **Community Forum:** [Proxmox Forum](https://forum.proxmox.com/)
- **Git Repository:** [Proxmox GitHub](https://git.proxmox.com/)
---
## **Conclusion**
Proxmox VE is a versatile, cost-effective, and open-source solution for server virtualization. Its extensive feature set, intuitive management tools, and robust community support make it an excellent choice for users at any skill level. Whether managing a small home lab or deploying enterprise-scale infrastructure, Proxmox provides the tools to simplify and optimize your virtual environment.
+12
View File
@@ -0,0 +1,12 @@
---
tags:
- Proxmox
- Resizing
---
sudo pvresize /dev/mapper/ubuntu--vg-ubuntu--lv /dev/sda3
sudo lvresize /dev/ubuntu-vg/ubuntu-lv /dev/sda2
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv