赞
踩
list
wsl -l 或 wsl --list 列出所有已安装虚拟机wsl -l -v 显示详细信息(也不怎么详细)wsl -l -o 列出网上可用的系统terminate
wsl -t ubuntu 关闭ubuntuwsl --shutdown 关闭所有系统及虚拟机引擎run
wsl -d ubuntu 启动ubuntu并进行终端wsl -u root 以root身份支行<distro>.exe config --default-user <username> 设置默认用户名ubuntu.exe config --default-user rootinstall
wsl --install 安装默认虚拟机(ubuntu)wsl -l -o 列出网上可用的系统执行命令
wsl <命令>
默认虚拟机
wsl 启动默认虚拟机并进入终端
wsl -s 虚拟机名 进入默认虚拟机
终端颜色
将默认用户改成root后终端没了颜色。
echo "source ~/.bashrc" >> ~/.bash_profile
vim /root/.bashrc,将39行的force_color_prompt=yes取消注释
网络连接
Accessing network applications with WSL | Microsoft Docs
虚拟机IP: ip a | grep eth0
物理机IP: cat /etc/resolv.conf,在nameserver后的是IP
GUI
卸载虚拟机
wsl --unregister <DistributionName>修改虚拟机名称
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。