I have some labs to do so I need a Linux enviroment. However, the XFCE Manjaro has some bugs:
- The bustub make file can not run on manjaro/arch linux
- The XFCE crashes sometimes
- The window manager is so poor
So I choose the Ubuntu 20.04 WSL on Windows10.
Without expectation, there are some things I need to configure.
When I install ubuntu, error occurs, so I just have a root
user, that sucks. I refer this.
I need a personal user aucker
, run the command:
adduser aucker
usermod -aG sudo aucker
I refer this method, in powershell:
ubuntu.exe config --default-user root
Then restart ubuntu, things will be fine.
After install the Ubuntu from Microsoft Store, use update and upgrade.
Then install some useful softwares
sudo apt install build-essential
sudo apt install ranger
MySQL1 ps:root1523
To install MySQL on WSL2, refer to official Microsoft Docs.:nerd_face:
There are several errors I encoutered when installing MySQL:
- MySQL won't start - error: su: warning: cannot change directory to /nonexistent: No such file or directory
- Failed! Error: SET PASSWORD has no significance for user ‘root’@’localhost’ as the authentication method used doesn’t store authentication data in the MySQL server
- ...
Just in my proxy Gist
After finished the installation of zsh
, change to zsh:
chsh -s $(which zsh)
Do not use sudo
!!!
After this command, you need to log out and relog in ubuntu.
Then, install oh-my-zsh
. This plugin sh file use curl
, so I need configure the .curlrc
file. Create .curlrc
file.
proxy="http://xxx.xxx.xxx.xxx:port"
refer the proxy section.
After the configuration of proxy, I can use curl, git, etc. Then run the following command in shell.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Then zsh configuration is finished.
In VS Code, install Remote Development
extension. Then in WSL, run code .
, normally, it will install code on terminal.
Then you can use VS Code in Ubuntu.
Besides, you can also use file explorer. run explorer.exe .
in WSL, you can get this:
Of course you can use \\wsl$
in the File explorer address bar, then you can go there directly.
Note: when you get errors like command not found
or zsh: input/output xxx
, try to restart your WSL:
wsl --shutdown
Perhaps this will help.
- Working across Windows and Linux file systems
- Set up a WSL development environment
- WSL config file
- set default user
- How To Create a New Sudo-enabled User on Ubuntu 20.04
- How To Install MySQL on Ubuntu 20.04
- ...