display-vm-on-pve-arm

abstract of this post

content of this post

有些系统支持

硬件,添加,串口

display 选择 串口

openwrt vm

https://medium.com/@aj.abdelwahed/openwrt-on-proxmox-ve-turn-your-raspberry-pi-into-a-networking-powerhouse-ee61bd2f342c

openwrt lxc1

这上面说的,好像不行

https://openwrt.org/docs/guide-user/virtualization/lxc

openwrt lxc2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash

# Setting Up OpenWRT on a Virtual Machine with Proxmox
# Based on: https://community.bigbeartechworld.com/t/setting-up-openwrt-on-a-virtual-machine-with-proxmox/257

# Set your wished version:
export VER="24.10"
export ARCH="arm64"
export INDEX_URL="https://images.linuxcontainers.org/images/openwrt/$VER/$ARCH/default"
#export BUILDDATE=$(date -d "yesterday" '+%Y%m%d')
export BUILDDATE=$(curl -sL $INDEX_URL | grep "<a href=" | sed -E 's/.*<a href="([^"]+)".*/\1/' | sort | tail -n 1 | tr -d \/)
export BD_URL="$INDEX_URL/$BUILDDATE"

echo; echo "[*] Setting Up OpenWRT Version $VER on a Virtual Machine with Proxmox"
echo "[*] Downloading by $BD_URL/ "
sleep 2
wget $BD_URL/rootfs.tar.xz -O /var/lib/vz/template/cache/OpenWrt-$VER.tar.xz
# lvm disk: 1G - RAM 1G - CPU 1Core 64bit
#
pct create 202 /var/lib/vz/template/cache/OpenWrt-$VER.tar.xz --arch $ARCH --hostname OpenWrt-$VER --rootfs local-lvm:1 --memory 1024 --cores 1 --ostype unmanaged --unprivileged 1

echo -e "
Add network on interface and setup network file via dhcp

(vi /etc/config/network):

config interface 'wrtb'
option type 'bridge'
option ifname 'eth0'
option proto 'dhcp'
"

exit 0;

immortalwrt

lxc

1
2
3
4
wget https://downloads.immortalwrt.org/releases/24.10.1/targets/armsr/armv8/immortalwrt-24.10.1-armsr-armv8-rootfs.tar.gz


pct create 700 /var/lib/vz/template/cache/immortalwrt-24.10.1-armsr-armv8-rootfs.tar.gz --arch arm64 --hostname immortalwrt --rootfs local:1 --memory 512 --cores 1 --ostype unmanaged --unprivileged 1

注意,我应该是遇到两次了,lxc运行后,dnsmq 不能启动导致不能上网

比如 ping baidu.com
bad address “baidu.com”

/etc/init.d/dnsmasq status
not running

解决
https://github.com/immortalwrt/immortalwrt/issues/1588

vim /etc/init.d/dnsmasq

删除或注释掉这几句

1
2
3
4
5
6
7
8
9
10
11
#       procd_add_jail dnsmasq ubus log                                                                                     
# procd_add_jail_mount $CONFIGFILE $DHCPBOGUSHOSTNAMEFILE $DHCPSCRIPT $DHCPSCRIPT_DEPENDS
# procd_add_jail_mount $EXTRA_MOUNT $RFC6761FILE $TRUSTANCHORSFILE
# procd_add_jail_mount $dnsmasqconffile $dnsmasqconfdir $resolvdir $user_dhcpscript
# procd_add_jail_mount /etc/passwd /etc/group /etc/TZ /etc/hosts /etc/ethers
# procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile
# case "$logfacility" in */*)
# [ ! -e "$logfacility" ] && touch "$logfacility"
# procd_add_jail_mount_rw "$logfacility"
# esac
# [ -e "$hostsfile" ] && procd_add_jail_mount $hostsfile

其它

临时设置ip

1
sudo ip addr add 192.168.122.94/24 dev enp6s19
0%