侧边栏壁纸
博主头像
Gerchart's Blog 博主等级

For the ideal life is the ideal of the life.

  • 累计撰写 5 篇文章
  • 累计创建 1 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

PVE Initialization

gerchart
2025-02-26 / 0 评论 / 0 点赞 / 50 阅读 / 0 字
温馨提示:
本文最后更新于2025-02-26,若内容或图片失效,请留言反馈。 部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

Delet Local LVM partition

  1. remove LVM partition
    lvremove pve/data
    
  2. Merge spare space (delected lvm) to pve/root, and resize local partition
    lvextend -rl +100%FREE pve/root
    resize2fs /dev/mapper/pve-root
    
  3. Go to Web page-datacenter-strorage, remove lvm partition.
  4. Edit local partition, select all member in content, then save.

Setting Passthrough

  1. Modify Grub config/etc/defualt/grub, by replace GRUB_CMDLINE_LINUX_DEFAULT="quiet" with
    GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"
    
  2. Update grub by update-grub
  3. 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
    
  4. Adding intel graphic driver to blacklist/etc/modprobe.d/pve-blacklist.conf
    blacklist i915
    blacklist snd_hda_intel
    
  5. Update initramfs, `update-initramfs -u -k all
  6. Reboot

Singbox TUN Mode

  1. Install ipks needed for sing box

     opkg install kmod-inet-diag kmod-netlink-diag kmod-tun iptables-nft
     opkg install sing-box
    
  2. Import singbox’s config to /etc/sing-box/config.json, then run sing-box run to check whether the sing-box start successfully.

  3. 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!"
    }
    
  4. 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

  5. Setting up interface and firewall in Luci-Web

    1. Go to interface page, add a new interface bound to tun(sing-box created), with no protocal.
    2. Go to firewall page, create a new zone for sing-box, which allows forward to or from lan zone, and select masquerading
    3. Add sing-box’s tun interface (added before) to sing-box zone.
    4. 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
0

评论区