banner
Kerronex

Kerronex

兴趣使然,一个随手记笔记本

When I decided to get a small host.

Of course, it's for making an All in one boom,
PVE + OpenWrt + Black Synology DSM + Windows 10 + Ubuntu + Docker + HAOS
And the outlaws go straight to RAID0!!

Install PVE#

Download the ISO image from the official website. I used Ventoy to boot, but you can also use a writing tool to directly write the ISO to a USB drive. Initially, I got stuck at loading because the version of Ventoy was too old; upgrading it fixed the issue (no need to format the drive).

There are many tutorials for installing PVE, and there aren't many points to note; as long as the IP is written correctly, there shouldn't be any problems.

Reference video: Use PVE virtual machines to create your own All In One system!

Two useful tools after installing PVE:

https://bbs.x86pi.cn/thread?topicId=20

https://github.com/ivanhao/pvetools
Just change the source, remove the subscription prompt, and you can use pvetools for direct disk passthrough.

About tagging: Click on Data Center - Options - Tag Style Settings - Complete; then go to the top bar of each node to add tags.

OpenWrt#

It's still recommended to install a soft router, but not for primary use; just set it up as a bypass gateway, for example, to solve issues like Docker not being able to pull images after installing magic.

The recommended video for soft routers is from the bad forest, which explains it clearly: https://youtu.be/JfSJmPFiL_s?si=09dZqcEKDu1anurs

Download the firmware: https://firmware-selector.immortalwrt.org/?version=23.05.4&target=x86%2F64&id=generic, it's recommended to choose COMBINED-EFI (SQUASHFS-COMBINED-EFI.IMG.GZ).

Upload the image, then use the command: qm importdisk 100 /var/lib/vz/template/iso/openwrt.img local-lvm to import it into the virtual machine.

Install the magic trio: openClash, homeProxy, passwall

If the network card's half virtualization doesn't work, switch back to E1000.

After testing, at least PVE8 doesn't need the img2kvm tool anymore; you can directly import using the qm command. Generally, a 2-core 1G configuration is sufficient.

However, I still haven't figured out OpenWrt; it's quite complex, so I'll study it later. Now I've deleted all the network cards...


Installing DDNS-Go with the router's port forwarding can achieve external network access, requiring a domain name, a bridge mode optical modem, and a public IP.

DSM#

I used the boot file from GXNAS, or you can check out the famous native RR boot, which is a revived version: https://github.com/RROrg/rr

The image from GXNAS directly supports virtual network cards, so just choose half virtualization for better performance.

As an All in one boom, I chose RAID0 here, fully loaded; data safety relies on my regular cold backups.

Windows/Linux#

I installed Win10 LTSC here; Win11 is a bit complicated, requiring UEFI + TPM and a Microsoft account login, so I didn't want to make it that complicated.

PS: The latest Win11 is also well optimized; 2G of memory runs light tasks very smoothly.

The VirtIO driver image can be found by visiting the page download the latest stable and clicking to download. For details, visit https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers

Windows is generally used via remote desktop; you can open it by right-clicking on the computer properties, and then you can connect using mstsc. The LTSC version of Win10 might cause the fan to spin wildly right after installation; this is a bug, and updating the system and restarting will fix it.


Linux is quite simple; just click next all the way, and it's no different from a physical machine. I installed Ubuntu Server.
Docker installation can use the [one-click script](bash <(curl -sSL https://linuxmirrors.cn/docker.sh)), and there's a similar [one-click source change script](bash <(curl -sSL https://linuxmirrors.cn/main.sh)).

If you need to allow remote login, modify /etc/ssh/sshd_config to change PermitRootLogin prohibit-password to PermitRootLogin yes, then restart the service with service ssh restart.

Docker#

Here I chose to use LXC to create a Docker. First, you need to download a CT template; I used Ubuntu's because to use DockerHub, the gateway uses the previous OpenWrt; make sure to uncheck the five privilege containers; after completion, check all the nested options in the features.

It's important to note that while LXC virtualization is efficient, it's not fully virtualized; it still shares some resources with the host or has limitations, so I didn't use LXC for Linux, but it feels okay for Docker.

To ensure Docker can start, you need to modify the corresponding LXC configuration in PVE. Add the following to /etc/pve/lxc/{CTID}.conf:

lxc.apparmor.profile: unconfined  
lxc.cgroup.devices.allow: a  
lxc.cap.drop:  

In most cases, Docker should run normally.

Use the shortcut command bash <(curl -sSL https://linuxmirrors.cn/docker.sh) to install Docker without changing the source.

After installation, first install a portainer:

docker run -d -p 8000:8000 -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data outlovecn/portainer-cn:latest  

Recommended services: run a speedtest to check the local network speed, or you can also use iperf3.

HAOS#

It's recommended to use Winter Melon HAOS, directly using the PE version ISO for one-click installation.

I haven't had time to study it in detail yet, but here are some plugins:

Tailscale#

Initially, I wanted to install it in Docker, but I didn't find any particularly good articles and didn't want to do it myself. Later, I saw many installations on OpenWrt, with most being installed in iKuai, which is relatively simple but clearly not suitable for me. However, there are two projects that seem good:

Unfortunately, after installation, I could log in, but the configured subnet routing was ineffective, probably related to the network ports I deleted earlier in OpenWrt, so I eventually gave up;

I ultimately adopted the solution from this expert, using LXC for installation, similar to the previous Docker configuration. You need to add the following to the /etc/pve/lxc/{CTID}.conf file to enable TUN:

# This 10 200 can be obtained by executing ls -al /dev/net/tun on PVE, usually 10 200  
lxc.cgroup2.devices.allow: c 10:200 rwm  
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file  

You also need to enable forwarding in /etc/sysctl.conf within LXC:

net.ipv4.ip_forward=1  
net.ipv6.conf.all.forwarding=1  

# Execute to take effect  
# sysctl -p /etc/sysctl.conf  

Then use the official script to install: curl -fsSL https://tailscale.com/install.sh | sh

Execute tailscale up --authkey=xxxxx --accept-routes --advertise-routes=192.168.0.0/24 to start, remembering to replace it with your own subnet and authkey.

Configure for automatic startup:

Use systemd to enable auto-start. Create a configuration file in /etc/systemd/system: tailscale.service, with the following content:

Description=AutoStart tailscale  
   After=tailscale.service  
Requires=tailscale.service  
   [Service]  
   Type=oneshot  
   ExecStart=/usr/bin/tailscale up --authkey=yourAuthKey --accept-routes --advertise-routes=yourForwardingRange  
   ExecStop=/usr/bin/tailscale down  
   RemainAfterExit=yes  
   Restart=on-failure  
   [Install]  
   WantedBy=multi-user.target  

Then execute the following commands:

systemctl enable tailscale.service  
systemctl start tailscale.service  

LXC#

Modify the hostname of LXC:

/var/lib/lxc/container_id/config  
/etc/pve/lxc/container_id.conf  

You can just modify the latter file; it's recommended to change both.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.