Delet Local LVM partition
- remove LVM partition
lvremove pve/data
- Merge spare space (delected lvm) to pve/root, and resize local partition
lvextend -rl +100%FREE pve/root resize2fs /dev/mapper/pve-root
- Go to Web page-datacenter-strorage, remove lvm partition.
- Edit local partition, select all member in content, then save.
Setting Passthrough
- Modify Grub config
/etc/defualt/grub
, by replaceGRUB_CMDLINE_LINUX_DEFAULT="quiet"
withGRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"
- Update grub by
update-grub
- Adding vfio module
/etc/modules
echo vfio >> /etc/modules echo vfio_iommu_type1 >> /etc/modules echo vfio_pci >> /etc/modules echo vfio_virqfd >> /etc/modules
- Adding intel graphic driver to blacklist
/etc/modprobe.d/pve-blacklist.conf
blacklist i915 blacklist snd_hda_intel
- Update initramfs, `update-initramfs -u -k all
- Reboot
Singbox TUN Mode
-
Install ipks needed for sing box
opkg install kmod-inet-diag kmod-netlink-diag kmod-tun iptables-nft opkg install sing-box
-
Import singbox’s config to
/etc/sing-box/config.json
, then runsing-box run
to check whether the sing-box start successfully. -
Setting up sing-box service by modifying the
/etc/init.d/sing-box
file to as follow:#!/bin/sh /etc/rc.common START=99 USE_PROCD=1 PROG=/usr/bin/sing-box RES_DIR=/etc/sing-box/ # resource dir / working dir / the dir where you store ip/domain lists CONF=./config.json # where is the config file, it can be a relative path to $RES_DIR start_service() { sleep 10 procd_open_instance procd_set_param command $PROG run -D $RES_DIR -c $CONF procd_set_param user root procd_set_param limits core="unlimited" procd_set_param limits nofile="1000000 1000000" procd_set_param stdout 1 procd_set_param stderr 1 procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}" procd_close_instance iptables -I FORWARD -o tun+ -j ACCEPT echo "sing-box is started!" } stop_service() { service_stop $PROG iptables -D FORWARD -o tun+ -j ACCEPT echo "sing-box is stopped!" } reload_service() { stop start echo "sing-box is restarted!" }
-
Using
/etc/init.d/sing-box enble
to let sing-box autobot, then using/etc/init.d/sing-box start/restart/stop
to control sing-box service -
Setting up interface and firewall in Luci-Web
- Go to interface page, add a new interface bound to tun(sing-box created), with no protocal.
- Go to firewall page, create a new zone for sing-box, which allows forward to or from lan zone, and select masquerading
- Add sing-box’s tun interface (added before) to sing-box zone.
- Restart singbox service
PVE_SOURCE
wget -q -O /root/pve_source.tar.gz 'https://bbs.x86pi.cn/file/topic/2023-11-28/file/01ac88d7d2b840cb88c15cb5e19d4305b2.gz' && tar zxvf /root/pve_source.tar.gz && /root/./pve_source
评论区