WSL2没有以下这些限制,请升级到WSL2:
http://trustcomputing.com.cn/bbs/viewthread.php?tid=1681
WSL1内不能运行netstat、systemctl、iptables、ikev2、ocserv(tun)、pptp(ppp0 WSL1)、l2tp(l2tp_ppp)、openvpn(tun)、Softether、nfs-server、cifs-server等与内核有关的程序,可以在Windows CMD中用netstat查看WSL中开放的端口
systemctl:
System has not been booted with systemd as init system (PID 1). Can't operate.
iptables:
iptables v1.8.4 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
ikev2:
no netkey IPsec stack detected
no KLIPS IPsec stack detected
no known IPsec stack detected, ignoring!
ocserv:
CTunTapMgr:
penDevice Return Code: -33030134 (0xFE08000A) Description: TUNTAPMGR_ERROR_TUN_DEVICE_OPEN_FAILED
pptp:
Couldn't open the /dev/ppp device: No such device or address
Please load the ppp_generic kernel module.
l2tp:
L2TP kernel support not detected (try modprobing l2tp_ppp and pppol2tp)
openvpn:
ERROR: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
Softether:
Error getting hardware address for "vpn_se": No such device
nfs-server:
System has not been booted with systemd as init system (PID 1). Can't operate.
cifs-server:
Failed to open nmb socket on interface 10.10.30.15 for port 137. Error was Address already in use
smbXsrv_version_global_init: failed to open[/run/samba/smbXsrv_version_global.tdb] - NT_STATUS_ACCESS_DENIED
可以在WSL1下运行的程序有:
DNS服务器、WEB服务器、WEB代理服务器、SS、SSH、Stunnel、TLSProxy、KMS、BT等
终止WSL1:
wsl -l
wsl -t Ubuntu
tasklist | findstr wsl
netstat -na | more
无法实现类似虚拟机那样的休眠再恢复?
WSL1自带的sshd有问题,需要重新安装:
apt remove openssh-server
apt install openssh-server
/usr/sbin/sshd
WSL下进入Windows自身的目录:
/mnt/盘符/dir
Windows CMD下直接执行WSL Linux命令:
bash.exe -c "ifconfig eth0 | grep 'inet '"
inet 192.168.1.98 netmask 255.255.255.0 broadcast 192.168.1.255
bash.exe -c "ls -lat /"
[
本帖最后由 linda 于 2020-9-1 18:45 编辑 ]