Skip to content

toss-a/PCT-patches

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Patches for PCT/PVE 9

Patch scripts to improve PCT/PVE 9:

Add OCI container type support to PCT, enabling Redroid container startup


Chinese Documentation | English Documentation

0. Warning Information

Important

Running Redroid PCT(LXC) containers may affect other PCT(LXC) containers, e.g.: Docker cannot start or NFS cannot be mounted inside other PCT(LXC) containers.
To avoid such issues, do not set Redroid PCT(LXC) containers to autostart.
To resolve this, set a non-OCI PCT(LXC) container (e.g., Debian 12) to autostart,
or manually start a non-OCI PCT(LXC) container (e.g., Debian 12) before running a Redroid PCT(LXC) container.
This ensures lxcfs initializes correctly, so running Redroid PCT(LXC) containers does not affect Docker or NFS in other PCT(LXC) containers.

Warning

  1. PVE Cluster Mode: The script has not been tested in cluster environments. Use in cluster mode is not recommended.
  2. Compatibility: This script is only tested and supported on fresh installations of PVE 9.1.1 ~ 9.1.4 and PVE 9.2.2.
    There may be unknown issues on other versions or non-fresh installations.
    Not tested on ARM64 PVE, not recommended for ARM64 users.
  3. To update the patch script, revert changes before updating.

Caution

  1. If you have used other PCT(LXC) related scripts, using this script may cause unpredictable issues (and vice versa).
  2. Please back up important data before using this script. All data loss caused by the script is the user's responsibility. Running the script means you accept this statement!
  3. After applying this script, do not update PVE. If you need to update PVE, please revert the changes first to avoid accidents.

1. Add OCI Container Type Support to PCT

Tip

It is recommended to use a fresh PVE 9.1 / 9.2 installation

1.1 Usage

Supported on PVE 9.1 / 9.2

If you use PVE 8, please use the pve-8 branch: https://github.com/toss-a/PCT-patches/tree/pve-8

On the PVE host, run in the Console (Shell):

git clone https://github.com/toss-a/PCT-patches
cd PCT-patches
bash Patch-for-PCT-to-support-oci.sh -e

To revert the script changes, run:

bash Patch-for-PCT-to-support-oci.sh -e -R

1.2 Supported Parameters

Usage: Patch-for-PCT-to-support-oci.sh [options]

Option Description
-h, --help Show this help message
-R, --restore Restore original files
-D, --del-backup Delete backup files after restore
-y, --yes Skip confirmation prompts
-c, --chinese Show messages in Chinese (default)
-e, --english Use English for messages

1.3 PCT Feature Support

  • Snapshots
  • Backup
  • Firewall
  • Template + Full Clone
  • Template + Linked Clone

Caution

After creating a Redroid PCT(LXC) container, if the container's OS Type is not Oci, or there are no Entrypoint and lxc.mount.auto parameter options:
First refresh the PVE WebUI to check for changes. If still missing, try rebooting PVE.
If the issue persists after reboot, rerun the script (ensure no containers/VMs are running), then try creating a new Redroid PCT(LXC) container.
To confirm success, see deployment screenshots.

2. Create Redroid LXC Container

Important

When creating the container, uncheck Unprivileged container

Download a template from Release.

2.1 Initialize the Container

Allocate at least 5GB for rootfs; at least 4GB (4096MB) RAM; set Swap to 0.

Parameter Value
rootfs ≥ 5GB
Memory ≥ 4096MB
Swap = 0

2.2 Configure Network

Tip

To disable IPv6, add androidboot.disable_ipv6=1 to the Entrypoint parameter [Lineage templates only]

Note

lxc.init.cmd has been replaced by Entrypoint on newer PVE/PCT versions.

Set IPv4 to DHCP. Regardless of IPv6 settings, Redroid PCT(LXC) containers will get a stateless IPv6 address.

2.3 Add User Data Storage

After creating the container, go to Resources and click Add to add a Mount Point. Set Path to /data, and disk size to at least 25G.

Parameter Value
Path /data
Disk Size ≥ 25G

2.4 [Optional] Configure GPU Acceleration

Note

This is equivalent to manually adding lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir to the config file

Click Add to add a Mount Entry. Set Source Path to /dev/dri, Target Path to /dev/dri, and Create Type to dir.

Parameter Value
Source Path /dev/dri
Target Path /dev/dri
Create Type dir

Important

PCT now auto-configures Entrypoint and lxc.mount.auto for OCI containers. No need to set these manually in Options.

For more Entrypoint parameters, see redroid-doc

2.5 Screenshots

Mount Entry feature for OCI containers (OCI only)

Image

Apparmor profile, Entrypoint and lxc.mount.auto for OCI containers (the latter two for OCI only)

Image


Original Author

lurenJBD

About

Patch script for improving PCT/PVE.

Resources

License

Stars

14 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages

  • Shell 100.0%