Make writing a habit together! This is my first day to participate in the “Gold Digging Day New Plan · April More text challenge”, click to see the details of the activity.

Since I bought my computer in my freshman year, the system disk is very small, while WSL is installed in disk C by default, occupying at least 20G. This paper is used to record the bumpy migration process.

record

  1. First download tool LxRunOffline, do not download other versions, there are pits

  2. Download unzip, open command line in this directory, run view subsystem, remember the name and so on.

    ./LxRunOffline.exe list
    Copy the code

  3. Check the directory where the subsystem resides:

    # Enter your subsystem name./ lxrunoffline. exe get-dir -n UbuntuCopy the code
  4. Set the destination directory permissions, that is, the file directory you want to migrate to:

    Icacls F:\Ubuntu /grant "Your username :(OI)(CI)(F)"Copy the code
  5. If you don’t know what the last user name was, you can use the whoanmi command to check:

  6. Starting the migration

    Exe move -n Ubuntu -d F:\Ubuntu\UbuntuCopy the code
  7. Wait patiently for completion

  8. You can also use the following command to check whether the installation path is correct:

    ./LxRunOffline.exe get-dir -n Ubuntu
    Copy the code

Install the WSL

By the way, update the installation process of WSL and OH-my-ZSH under Win11

  1. All you need to do is enter:

    wsl --install
    Copy the code
  2. The default is Ubuntu, but you can also choose from other Linux distributions by clicking here

  3. After the installation is complete, restart the application, go to Ubuntu, open the application, and set the username and password

  4. Better used with Windows Terminal.

oh-my-zsh

Only installation, plug-in related can search ✔️

  1. First, install ZSH

    sudo apt install zsh
    Copy the code
  2. Make it the default shell

    chsh -s $(which zsh)
    Copy the code
  3. Restart the terminal and enter echo $SHELL. If /bin/zsh is displayed, the configuration is successful

  4. Then install oH-my-zsh

    sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
    Copy the code
  5. If you get an error, go to the site and copy the entire content and paste it into a test.sh file

    Chmod +x test.shCopy the code