Windows下Ubuntu自启动(固定wsl2的ip地址)
创建wsl2-start.bat批处理文件
wsl -d Ubuntu-20.04 -u root /etc/init.wsl
# 指定发行版子系统,添加一个 eth0:1 网卡
# wsl -d Ubuntu-20.04 -u root ip addr add 172.20.20.20/20 broadcast 172.20.81.255 dev eth0 label eth0:1
# 在Win11中添加IP地址
netsh interface ip add address "vEthernet (WSL)" 172.20.20.80 255.255.255.0
Ubuntu中写入init.wsl文件
#ssh
/etc/init.d/ssh start
#network static ip
ip addr add 172.20.20.20/20 broadcast 172.20.81.255 dev eth0 label eth0:1
#bt
/etc/init.d/bt restart
固定wsl2的ip地址
创建wsl2-start.bat批处理文件的快捷方式,用Quicker进行快捷方式开机自启动
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 Eternal Night
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果