系统更新
1
| apt update && apt dist-upgrade
|
取消订阅
nano /etc/apt/sources.list
取消订阅
nano /etc/apt/sources.list.d/pve-enterprise.list
注释掉订阅
1
| # deb <http://enterprise.proxmox.com/debian/pve> bullseye pve-enterprise
|
apt-get update
初始化磁盘
fdisk /dev/sdc
进入fdisk
输入 p 查看磁盘分区
输入 d 删除分区
输入 w 保存
在命令行中查看磁盘 S.M.A.R.T 信息: smartctl -a /dev/sdc
打开 iommu & pci passthrough
直通硬件,主板支持 iommu
Inter cpu填写 intel_iommu=on
AMD CPU填写 amd_iommu=on
填写完 使用 update-grub
更新 grub
命令行运行 dmesg | grep -e DMAR -e IOMMU 如果没有输出,则说明有问题。
更新完后 reboot 系统。
其他参数:
关闭核显,
添加 VLan 桥接网口
查看网络端口信息
1
| nano /etc/network/interfaces
|
硬盘 直通
1 2 3 4 5 6 7 8 9 10
| apt-get install lshw # 查看硬盘ID ls -l /dev/disk/by-id
# 设置 qm set 103 --sata1 /dev/disk/by-id/ata-TOSHIBA_D100 qm set 103 --sata2 /dev/disk/by-id/ata-ST1000LM024
# 无需借助任何软件直接转换openwrt的img文件为虚拟磁盘 qm importdisk 101 /var/lib/vz/template/iso/openwrt_esir.img local-lvm
|
GPU 直通
设置 grub
nano /etc/default/grub
1 2
| // 修改此处 GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on pcie_acs_override=downstream,multifunction video=efifb:eek:ff"
|
update-grub
// 设置 modules
nano /etc/modules
1 2 3 4
| vfio vfio_iommu_type1 vfio_pci vfio_virqfd
|
// 重启
reboot
// 修改虚拟机配置文件 修改cpu
nano /etc/pve/qemu-server/100.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| agent: 1 balloon: 4096 bios: ovmf boot: cdn bootdisk: virtio0 cores: 8 cpu: host,hidden=1,flags=+pcid efidisk0: fast1:vm-100-disk-1,size=128K hostpci0: 02:00,pcie=1,x-vga=1 hostpci1: 04:00.0,rombar=0 ide0: none,media=cdrom machine: q35 memory: 14336 name: beam numa: 0 ostype: win10 scsihw: virtio-scsi-pci smbios1: uuid=d6febb0d-4242-4bdb-8aea-7c03e7b5df0e sockets: 1 unused0: storage1:vm-100-disk-0 unused1: slow1:vm-100-disk-0 virtio0: fast1:vm-100-disk-0,size=80G vmgenid: 524a58dd-7e3e-44f4-abf4-9de0f490d936
|
// 屏蔽掉系统驱动
nano /etc/modprobe.d/pve-blacklist.conf
1 2 3 4
| blacklist nvidiafb blacklist nvidia blacklist radeon blacklist nouveau
|
网络测速
1 2 3 4 5 6 7 8 9
| sudo apt install speedtest-cli speedtest
apt-get install npm npm install --global fast-cli fast fast -u
|
文件路径
1 2 3 4 5
| Backups - /var/lib/vz/dump ISOs - /var/lib/vz/template/iso Images - /var/lib/vz/images Templates - /var/lib/vz/template/cache
|
配置网关
1 2 3 4
| # Edit nano /etc/network/interfaces # 重启网络 /etc/init.d/networking restart
|
挂载Img 文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| fdisk /var/lib/vz/template/iso/DS918_7.1.1.img
Command (m for help): p Disk /var/lib/vz/template/iso/DS918_7.1.1.img: 160 MiB, 167772160 bytes, 327680 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x1ef471e9
Device Boot Start End Sectors Size Id Type /var/lib/vz/template/iso/DS918_7.1.1.img1 2048 133119 131072 64M 83 Linux /var/lib/vz/template/iso/DS918_7.1.1.img2 133120 319487 186368 91M 83 Linux /var/lib/vz/template/iso/DS918_7.1.1.img3 319488 327679 8192 4M 83 Linux
mount -o loop,offset=1048576 /var/lib/vz/template/iso/DS918_7.1.1.img /mnt/img
|
其他资料
https://github.com/xiangfeidexiaohuo/ProxmoxVE-7.0-DIY