2025년 1월 30일 목요일

WSL/Ubuntu 22.04 재설치

WSL/Ubuntu 22.04 재설치

[주] NSPL 0.5um CMOS 오픈-소스 디자인 킷을 활용한 설계 환경이 WSL2/Ubuntu 20.04 기반에서 22.04로 변경 합니다. 큰 차이점이라면 gcc/g++, clang/clang++ 버젼이 9에서 11로 업그레이드 되어서 c++2a 표준을 지원 합니다. 일부 오픈-소스 도구에서 요구하던 <coroutine> 을 쓸 수 있고, Python3 는 3.10으로 변경되어 병렬처리 등이 강화 되었습니다.

Contents:

    Step 1) Shutdown WSL
    Step 2) Uninstall Ubuntu 20.04 (CCleaner)
    Step 3) Unregister Old Ubuntu 20.04
    Step 4) Check if "VHDX" file removed & Clean Registry (CCleaner)
    Step 5) At Microsoft Store, "Get" & "Install" Ubuntu 22.04.5 & "Open" it.
    Step 6) Move Virtual disk to other location
    Step 7) Set default user
    Step 8) Unique Apps for Open-Source EDA

---------------------------------------------------

Step 1) Shutdown WSL

    PS> wsl --shutdown
    PS> wsl -l -v

Step 2) Uninstall Ubuntu 20.04 (CCleaner)

Step 3) Unregister Old Ubuntu 20.04

    PS> wsl --uninstall
    PS> wsl --unregister Ubuntu-20.04
    PS> wsl -l -v
    PS> wsl --set-default-version 2
    PS> wsl --update

Step 4) Check if "VHDX" file removed & Clean Registry (CCleaner)

Step 5) At Microsoft Store, "Get" & "Install" Ubuntu 22.04.5 & "Open" it.

    Then you may see followings;

        Installing, this may take a few minutes...
        Please create a default UNIX user account. The username does not need to match your Windows username.
        For more information visit: https://aka.ms/wslusers
        Enter new UNIX username: goodkook
        New password:
        Retype new password:
        passwd: password updated successfully
        Installation successful!
        To run a command as administrator (user "root"), use "sudo <command>".
        See "man sudo_root" for details.
        
        Welcome to Ubuntu 22.04.5 LTS (GNU/Linux 5.15.167.4-microsoft-standard-WSL2 x86_64)
        
        * Documentation:  https://help.ubuntu.com
        * Management:     https://landscape.canonical.com
        * Support:        https://ubuntu.com/pro
        
        System information as of Thu Jan 30 17:44:38 KST 2025
        
        System load:  0.29                Processes:             32
        Usage of /:   0.1% of 1006.85GB   Users logged in:       0
        Memory usage: 1%                  IPv4 address for eth0: 172.17.11.1
        Swap usage:   0%
        This message is shown once a day. To disable it please create the
        /home/goodkook/.hushlogin file.
        goodkook@GoodKook-Skull:~$

Step 6) Move Virtual disk to other location;

    6-1: Create D:\WSL2

    6-2: Install git for Windows

        https://git-scm.com/download/win

    6-3: Move to ...

        PS> wsl -l -v
        PS> wsl --shutdown
        PS> cd d:\WSL2
        PS> git clone https://github.com/pxlrbt/move-wsl.git
        PS> cd move-wsl
        PS> ./move-wsl.ps1

    6-4: Then, you may see followings;

        PS D:\WSL2\move-wsl>
        PS D:\WSL2\move-wsl> ./move-wsl.ps1
            Getting distros...
            Select distro to move:
            1: Ubuntu-22.04
            1
            Enter WSL target directory:
            d:\WSL2
            Move Ubuntu-22.04 to "d:\WSL2"? (Y|n): Y
            Exporting VHDX to "d:\WSL2\Ubuntu-22.04.tar" ...
            Export in progress, this may take a few minutes..wsl: Unknown key 'user.default' in C:\Users\goodkook\.wslconfig:2
        
        The operation completed successfully.
        Unregistering WSL ...
        Importing Ubuntu-22.04 from d:\WSL2...
        Import in progress, this may take a few minutes....wsl: Unknown key 'user.default' in C:\Users\goodkook\.wslconfig:2
        
        The operation completed successfully.
        Cleaning up ...
        Done!

    If it wouldn't run,

        PS> Set-ExecutionPolicy Unrestricted    

    6-5: Check the VHDX moved,

        PS D:\WSL2\move-wsl> cd ..
        PS D:\WSL2> ls
    
            Directory: D:\WSL2
    
        Mode                 LastWriteTime         Length Name
        ----                 -------------         ------ ----
        d----          24/05/2024    22:56                move-wsl
        -a---          30/01/2025    17:58     1326448640 ext4.vhdx    

    6-6: Launch Ubuntu with <user name>

        PS D:\WSL2> wsl -u goodkook

        wsl: Unknown key 'user.default' in C:\Users\goodkook\.wslconfig:2
        To run a command as administrator (user "root"), use "sudo <command>".
        See "man sudo_root" for details.
        
        goodkook@GoodKook-Skull:/mnt/d/WSL2$ cd
        goodkook@GoodKook-Skull:~$ pwd
        /home/goodkook
        goodkook@GoodKook-Skull:~$ whoami
        goodkook

    6-7: Pin "Ubuntu 22.04.5" to task-bar

    

Step 7) Set default user,

    7-1: in the file, C:\Users\goodkook\.wslconfig

            [user]
            default=goodkook

            [wsl2]
            memory=24GB

    7-2: Set default user.

        Open Ubuntu terminal, you may see welcome message, logged with "root" at this time;

        Welcome to Ubuntu 22.04.5 LTS (GNU/Linux 5.15.167.4-microsoft-standard-WSL2 x86_64)
        
        * Documentation:  https://help.ubuntu.com
        * Management:     https://landscape.canonical.com
        * Support:        https://ubuntu.com/pro
        
        System information as of Thu Jan 30 18:14:17 KST 2025
        
        System load:  0.0                 Processes:             62
        Usage of /:   0.1% of 1006.85GB   Users logged in:       0
        Memory usage: 1%                  IPv4 address for eth0: 172.17.11.1
        Swap usage:   0%
        
        
        This message is shown once a day. To disable it please create the
        /root/.hushlogin file.
        root@GoodKook-Skull:~# <-------------- root user's ptompt

    7-3: Set default user,

        Ref) WSL Advanced WSL Config:
            https://learn.microsoft.com/ko-kr/windows/wsl/wsl-config

        root@GoodKook-Skull:/etc# cat /etc/wsl.conf
        
            [boot]
            systemd=true

            [user]
            default=goodkook

            [interop]
            appendWindowsPath=false

        Once wsl.config changed, restart WSL

            PS> wsl --shutdown


Step 8) Unique Apps for Open-Source EDA

    8-0. Open-Source Silicon EDA

        https://fun-teaching-goodkook.blogspot.com/2025/01/2025-1-mpw.html

        USB device sharing (usbipd),

        https://github.com/dorssel/usbipd-win/releases

        And "Arduino Board Emulation(How-To)"

        https://fun-teaching-goodkook.blogspot.com/2024/04/etri-05um-cmos-dk-fir8-2systemc.html

    8-1. KiCad

        $ sudo add-apt-repository ppa:kicad/kicad-8.0-releases
        $ sudo sudo apt update
        $ sudo apt install kicad

    8-2. Arduino IDE

        https://www.arduino.cc/en/software

    8-3. Gowin IDE & Programmer (Educational version)

        https://www.gowinsemi.com/en/support/download_eda/

    8-4. File browser, 'nemo', Text Editor 'gedit', image viewer 'nomacs', pdf viewer 'okular'

        $ sudo apt install nemo gedit gedit-plugin-multi-edit nomacs okular

    8-5. Microsoft Code (Windows version connect remotely to WSL)

        https://code.visualstudio.com/











댓글 없음:

댓글 쓰기