{"id":15801569,"url":"https://github.com/creativenull/wsl2-distro-ubuntu","last_synced_at":"2026-02-27T01:32:49.923Z","repository":{"id":214898771,"uuid":"737614390","full_name":"creativenull/wsl2-distro-ubuntu","owner":"creativenull","description":"Ubuntu container setup for my dev environment in WSL2","archived":false,"fork":false,"pushed_at":"2024-06-16T17:38:22.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-06T01:23:18.532Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/creativenull.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-31T18:50:18.000Z","updated_at":"2024-06-16T17:38:25.000Z","dependencies_parsed_at":"2024-06-16T19:10:49.301Z","dependency_job_id":"d6c5ea83-c9a7-4585-bfb5-2b8bdbab33c8","html_url":"https://github.com/creativenull/wsl2-distro-ubuntu","commit_stats":null,"previous_names":["creativenull/wsl2-distro-ubuntu"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/creativenull/wsl2-distro-ubuntu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativenull%2Fwsl2-distro-ubuntu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativenull%2Fwsl2-distro-ubuntu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativenull%2Fwsl2-distro-ubuntu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativenull%2Fwsl2-distro-ubuntu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creativenull","download_url":"https://codeload.github.com/creativenull/wsl2-distro-ubuntu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creativenull%2Fwsl2-distro-ubuntu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29880775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"ssl_error","status_checked_at":"2026-02-26T23:50:46.793Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-05T01:23:12.470Z","updated_at":"2026-02-27T01:32:49.906Z","avatar_url":"https://github.com/creativenull.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom Ubuntu Distro for WSL\n\nThis repo is just a README file for me to setup a development environment in WSL2.\n\nThere is plan to create scripts to automate it, but will most likely reside on my dotfiles repo.\n\nAdapted from [https://learn.microsoft.com/en-us/windows/wsl/use-custom-distro](https://learn.microsoft.com/en-us/windows/wsl/use-custom-distro)\n\n## Requirements\n\n- Docker for Windows - [https://docker.com/download](https://docker.com/download)\n- PowerShell Core - [https://github.com/PowerShell/PowerShell](https://github.com/PowerShell/PowerShell)\n- Windows terminal - [https://github.com/microsoft/terminal](https://github.com/microsoft/terminal)\n\n## 1. Create tar file\n\nFor the latest LTS version (22.04). All commands to be run in powershell.\n\n```pwsh\ndocker run -t ubuntu:22.04 /usr/bin/ls\n```\n\nGet the container ID.\n\n```pwsh\ndocker container ls -a\n```\n\nExport to a tar file.\n\n```pwsh\ndocker export [id] \u003e C:\\path\\to\\ubuntu.tar\n```\n\nWhere `[id]` is the container ID.\n\n## 2. Import to WSL\n\n```pwsh\nwsl --import DevMachine C:\\path\\to\\install\\dir C:\\path\\to\\ubuntu.tar\n```\n\nRe-open windows terminal and check if you can enter the container.\n\n```pwsh\nwsl -d DevMachine\n```\n\nIf you enter into the root shell then it's successfully installed.\n\n## 3. Container setup\n\n\u003e [!IMPORTANT]\n\u003e We are now inside the ubuntu container. So powershell commands will not work in the container.\n\nSetup the container for the user, while inside the container. Uncompress the container since it was\na docker container before, we want the full ubuntu experience now.\n\n```sh\nunminimize\n```\n\nInstall core tools for the devlopment environment.\n\n```sh\napt install -y nano vim curl wget unzip zip git man-db locales locate build-essential autoconf sudo systemd systemd-sysv iproute2 python3 python3-pip\n```\n\nSetup python.\n\n```sh\nupdate-alternatives --install /usr/bin/python python /usr/bin/python3 1\n```\n\nSet the locale, selecting `en_US`. This is needed by `asdf` to setup up nodejs and php.\n\n```sh\ndpkg-reconfigure locales\n```\n\n## 4. WSL Settings\n\n- Create a user and add to the sudo group.\n- Disable interop with the windows host, which will be done via `/etc/wsl.conf`.\n\n```sh\nadduser creativenull\nusermod -aG sudo creativenull\n```\n\nCreate or edit the `/etc/wsl.conf` file and add the following contents.\nRef [https://learn.microsoft.com/en-us/windows/wsl/wsl-config](https://learn.microsoft.com/en-us/windows/wsl/wsl-config).\n\n```\n[user]\ndefault = [user name]\n\n[interop]\nenabled = false\nappendWindowsPath = false\n\n[boot]\nsystemd = true\n```\n\nWhere `[user name]` is the user you want to create.\n\nNow, logout and terminate the container and try to enter it (this is in powershell/windows terminal).\n\n```sh\nexit\n\n# Below is in powershell once you exit\nwsl --terminate Ubuntu\nwsl -d Ubuntu\n```\n\nPerform a quick check with `whoami` and if it's the user you created then it was successful.\n\n## 4. Dev Setup (WIP)\n\n\u003e [!IMPORTANT]\n\u003e Requires [dotfiles repo](https://github.com/creativenull/dotfiles.git)\n\n```sh\ngit clone https://github.com/creativenull/dotfiles.git ~/dotfiles\n```\n\n### Shell\n\nUsing zsh and tmux.\n\n```sh\nsudo apt install -y zsh tmux\nsh -c \"$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)\"\nrm ~/.zshrc\nln -s ~/dotfiles/zshrc ~/.zshrc\nln -s ~/dotfiles/tmux.conf ~/.tmux.conf\n```\n\nInstall optional artisan plugin for zsh.\n\n```sh\ngit clone https://github.com/jessarcher/zsh-artisan.git ~/.oh-my-zsh/custom/plugins/artisan\n```\n\nRe-open terminal to see the changes.\n\n### Core\n\nInstall `lsd` to replace `ls`.\n\n```sh\ncd ~\nwget https://github.com/lsd-rs/lsd/releases/download/v1.0.0/lsd_1.0.0_amd64.deb\nsudo dpkg -i lsd_1.0.0_amd64.deb\nrm lsd_1.0.0_amd64.deb\n```\n\nGenerate ssh key for Github, etc. Copy the `.pub` contents when create a new ssh key in Github settings.\n\n```sh\nssh-keygen -t ed25519 -C [email]\n```\n\nWhere `[email]` is your Github email.\n\n### MYSQL\n\n```sh\nsudo apt install -y mysql-server\nsudo systemctl enable mysql\nsudo systemctl start mysql\n```\n\nSet a user and password give it all grants for local development (Not production).\nRef [https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-22-04](https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-22-04)\n\n```sh\nsudo mysql\n```\n\n```sql\nCREATE USER 'creativenull'@'localhost' IDENTIFIED BY 'password';\nGRANT ALL PRIVILEGES ON *.* TO 'creativenull'@'localhost' WITH GRANT OPTION;\nFLUSH PRIVILEGES;\nexit;\n```\n\n### Git\n\n```sh\nln -s ~/dotfiles/gitconfig ~/.gitconfig\n```\n\n### asdf\n\nInstall asdf and plugins.\n\nFollow the [zsh \u0026 git section](https://asdf-vm.com/guide/getting-started.html#_3-install-asdf) to setup asdf for zsh. Add this to `~/.zprofile` and NOT `~/.zshrc`.\n\n```sh\ngit clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.13.1\n\n# node\nasdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git\nasdf install nodejs 20.14.0\nasdf global nodejs 20.14.0\n\n# php\nasdf plugin add php https://github.com/asdf-community/asdf-php.git\nsudo apt install -y autoconf bison build-essential curl gettext git libgd-dev libcurl4-openssl-dev libedit-dev libicu-dev libjpeg-dev libmysqlclient-dev libonig-dev libpng-dev libpq-dev libreadline-dev libsqlite3-dev libssl-dev libxml2-dev libzip-dev openssl pkg-config re2c zlib1g-dev\nasdf install php 8.2.20\nasdf global php 8.2.20\n```\n\n### Deno\n\n```sh\ncurl -fsSL https://deno.land/x/install/install.sh | sh\n```\n\nAdd the export instructions to `~/.zprofile`.\n\n### Editor\n\nInstall the essential editor tools before installing neovim.\n\n```sh\nsudo apt install -y ripgrep\n```\n\nInstall packages for neovim build. Ref [https://github.com/neovim/neovim/blob/master/BUILD.md](https://github.com/neovim/neovim/blob/master/BUILD.md)\n\n```sh\nsudo apt-get install -y ninja-build gettext cmake unzip curl\n```\n\nClone neovim into `~/.builds`. Specify the nvim version to checkout.\n\n```sh\ngit clone https://github.com/neovim/neovim.git ~/.builds/neovim\ncd ~/.builds/neovim\ngit checkout v0.10.0\n```\n\nBuild the binary.\n\n```sh\nmake CMAKE_BUILD_TYPE=Release\nsudo make install\n```\n\nFinally, add my config.\n\n```sh\nln -s ~/dotfiles/config/nvim ~/.config/nvim\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreativenull%2Fwsl2-distro-ubuntu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreativenull%2Fwsl2-distro-ubuntu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreativenull%2Fwsl2-distro-ubuntu/lists"}