wsl重启操作

wsl环境下reboot和shutdown都是没有作用的,wsl可以通过windows命令行进行重启,使用管理员权限运行下面脚本实现重启:

rem 以管理员权限运行
net stop LxssManager
net start LxssManager

其他脚本(Linux 4.19.104、Debian 10、gcc 8.3.0):

/etc/apt/sources.list:

deb http://mirrors.163.com/debian/ buster main non-free contrib
deb http://mirrors.163.com/debian/ buster-updates main non-free contrib
deb http://mirrors.163.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ buster main non-free contrib
deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib
deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib

#运行 apt-get update 进行更新

/etc/vim/vimrc.tiny:

" set compatible
set nocompatible

启动sshd:

service ssh status
if [ $? != "0" ]; then
        service ssh start
        echo "sshd start..."
fi

 

你可能感兴趣的:(tools)