2023

您所在的位置:网站首页 openwrt安装宝塔 2023

2023

2023-05-10 02:59| 来源: 网络整理| 查看: 265

在玩客云的ARM软路由中安装了openwrt-11.28.2022-meson-meson8b-thunder-onecloud-burn-by264519395,但是更多合适的系统只有OpenWRT,故可使用chroot建立一个桌面环境来利用多余的性能。

首先,通常OpenWRT重置的shell为ash,在chroot后会因为找到替代的ash而切换失败,需要替换的shell为bash,通过$SHELL环境变量可以查看当前的shell:

echo $SHELL

如果已经是/bin/bash,则无需手动安装,否则需要使用opkg安装bash并手动设置:

opkg update && opkg install bash

随后可以开始安装debian替代,假设放置路径为/debian, 版本使用debian10 (buster),debian11(bullseye), 构架使用armhf, 配置。然后修改/etc/passwd中根行的/bin/ash为/bin/bash立即。 清华源:http://mirrors.tuna.tsinghua.edu.cn/debian

opkg install debootstrap mkdir /debian debootstrap --arch=arm64 buster /debian [http://mirrors.tuna.tsinghua.edu.cn/debian]

debootstrap将重置安装完毕后,需手动将/proc,/sys,/dev添加到目录的目录中:

mount -o bind /proc /debian/proc mount -o bind /sys /debian/sys mount -o bind /dev /debian/dev mount -o bind /dev /pts/debian/dev/pts

注意,重启后上述挂载目录重置,需要重新挂载,当然也可以添加到OpenWRT的启动脚本中。 之后就可以使用chroot切换到debian环境了:

chroot /debian

如果需要将这个切换的终端在后台保持,可配合screen命令(可使用opkg install screen安装)使用:

screen -S myterminal chroot /debian

之后可通过点击Ctrl + A后再点击D将终端切换回后台。再使用

screen -r myterminal

返回该终端。使用屏幕将终端搁置到后台后,当前登录的终端即使退出了,debian中的程序仍会保持在后台运行,这样就可以在debian中配置桌面和vnc,再从外部连接到该桌面了。 安装xfce4桌面和vncserver:

apt-get update && apt-get upgrade -y apt-get install xfce4 tightvncserver

安装完成后配置vncserver: 先直接运行vncserver以生成配置文件,这里将要求设置vnc的连接密码,此部分日志记录如下:

作者:粗识名姓 链接:https://www.jianshu.com/p/ac69215c80d1 来源:简书 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3