{"id":30438649,"url":"https://github.com/biswa96/initrdg","last_synced_at":"2025-08-23T04:14:55.731Z","repository":{"id":49310485,"uuid":"430281815","full_name":"Biswa96/initrdg","owner":"Biswa96","description":"initrd binary to experiment with WSLg in Windows 10","archived":false,"fork":false,"pushed_at":"2023-01-26T15:35:22.000Z","size":88,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-05T16:24:34.249Z","etag":null,"topics":["c","initramfs","initrd","windows-subsystem-for-linux","windows-subsystem-linux","wsl"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Biswa96.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}},"created_at":"2021-11-21T05:29:30.000Z","updated_at":"2024-03-14T02:54:52.000Z","dependencies_parsed_at":"2023-02-14T18:46:26.785Z","dependency_job_id":null,"html_url":"https://github.com/Biswa96/initrdg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Biswa96/initrdg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Biswa96%2Finitrdg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Biswa96%2Finitrdg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Biswa96%2Finitrdg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Biswa96%2Finitrdg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Biswa96","download_url":"https://codeload.github.com/Biswa96/initrdg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Biswa96%2Finitrdg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271740732,"owners_count":24812642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["c","initramfs","initrd","windows-subsystem-for-linux","windows-subsystem-linux","wsl"],"created_at":"2025-08-23T04:14:50.339Z","updated_at":"2025-08-23T04:14:55.719Z","avatar_url":"https://github.com/Biswa96.png","language":"C","readme":"# [initrdg](https://github.com/Biswa96/initrdg)\n\ninitrd binary to experiment with WSLg in Windows 10\n\n:warning: **Disclaimer:** At time of this writing, [WSLg] (GUI support in WSL)\nis not available in Windows 10. This project is just to experiment with that.\nThis is not a replacement of actual WSLg shipped in Windows 11. Please use this\nonly for fun and experimental purposes. Also backup your WSL setup before using\nthis program. This may totally destroy your current WSL environment.\n\n[WSLg]: https://github.com/microsoft/wslg\n\n## Table of contents\n\n* [Assumptions](#assumptions)\n* [Preparation](#preparation)\n* [How to use](#how-to-use)\n* [Differences with initrd](#differences-with-initrd)\n* [Caveats](#caveats)\n* [Acknowledgments](#acknowledgments)\n* [License](#license)\n\n## Assumptions\n\nThis program assumes some certain aspects by default which are as following:\n\n* WSL msix is extracted at `C:\\WSL` path. Feel free to change the folder path.\nBut you also have to change the path in [SystemDistro.reg](SystemDistro.reg)\nfile and the environment variable listed in [how to use](#how-to-use) section.\n\n* This project has been tested in Windows 10 21H1 Version 10.0.19043.928.\nThe messages between initrd and Lxss service are varied with Windows versions.\nFeel free to modify this project for your own Windows version.\n\n* Every binaries are compiled in Alpine Linux and with musl libc \u0026 gcc.\nFeel free to use any compiler toolchain and libc.\n\n## Preparation\n\n:warning: **Warning:** The following steps requires read/write permission in\nSystem32 folder. Any type of wrong step may make your entire WSL setup or even\nthe operating system unusable.\n\n* Download WSL msixbundle package from [WSL Release page]. In that msixbundle,\nextract the ARM64 or X64 msix according to your CPU architecture. Extract the\nmsix in `C:\\WSL` path (default) or at your choice (need modification). Use any\nprogram that can extract from ZIP format e.g. unzip, 7zip etc.\n\n[WSL Release page]: https://github.com/microsoft/WSL/releases\n\n* In `C:\\WSL` directory, remove the following two lines from wslg.rdp file.\nThis enables full desktop mode instead of separate application window mode.\n\n```\nremoteapplicationmode:i:1\nremoteapplicationprogram:s:dummy-entry\n```\n\n* In `C:\\WSL` directory, convert the system.vhd to ext4.vhdx file. Because Lxss\nservice expects the WSL distribution in exactly ext4.vhdx named file. Use this\ncommand in Powershell.\n\n```\nConvert-VHD -Path \"system.vhd\" -DestinationPath \"ext4.vhdx\"\n```\n\n* Double click on the [SystemDistro.reg](SystemDistro.reg) file to register\nthe ext4.vhdx file with \"system\" named distribution in WSL2 environment.\nMake sure there is no distribution with \"system\" name before that.\n\n* Backup and Rename the initrd.img file in `C:\\Windows\\System32\\lxss\\tools`\ndirectory to something else. Clone this repository. Run `make` command in any\nGNU/Linux distribution to compile the initrd.img file. Copy the newly compiled\ninitrd.img file to that `C:\\Windows\\System32\\lxss\\tools` directory.\n\n* Check out Win10 branch in [my fork of wslg](https://github.com/Biswa96/wslg).\nRun `make` command in WSLGd directory to compile WSLGd static executable.\nRemember the full path of that for later use.\n\n## How to use\n\n* Run your preferred GNU/Linux distribution in WSL2.\n\n* Execute `wsl.exe -d system -u root` to run the newly registered \"system\"\ndistribution with root user.\n\n* Run the following commands in both your running distribution and \"system\"\ndistribution as well. This step may not required in future, just thoughts.\nThe `\u003cguid\u003e` is retrieved from `hcsdiag.exe list` command output.\n\n```sh\nexport WAYLAND_DISPLAY=wayland-0\nexport DISPLAY=:0\nexport XDG_RUNTIME_DIR=/mnt/wsl/runtime-dir\nexport PULSE_SERVER=/mnt/wsl/PulseServer\nexport WSL2_INSTALL_PATH=\"C:\\\\WSL\"\nexport WSL2_EXECUTION_ALIAS_PATH=\"C:\\\\WSL\"\nexport WSL2_WESTON_SHELL_OVERRIDE=desktop-shell\nexport WSL2_VM_ID=\u003cguid\u003e\n```\n\n* Run previously compiled WSLGd binary in \"system\" distribution. The WSLGd will\ninvoke `C:\\WSL\\msrdc.exe` executable and show a warning window to accept network\nconnections. Click on \"Connect\" button to allow it.\n\n* Now run any GUI program in your distribution :tada:\n\n## Differences with initrd\n\nThis project is not an replacement of initrd binary which already exists in\nWindows 10 and 11 systems. This does NOT do:\n\n* Import or export distributions in WSL2.\n* Convert distributions from WSL1 to WSL2 or vice-versa.\n* Create or attach swap file.\n* Execute localhost or telemetry processes.\n* Compact memory.\n\n## Caveats\n\n* Every GUI applications are in one big window. Because Wayland apps become\nunresponsive in rdprail-shell which is used by-default to show apps in separate\nwindows.\n\n## Acknowledgments\n\nEveryone in the discussions:\n\n* [wslg#82](https://github.com/microsoft/wslg/discussions/82)\n* [wslg#347](https://github.com/microsoft/wslg/issues/347)\n* [wslg#441](https://github.com/microsoft/wslg/issues/414)\n* [wslg#446](https://github.com/microsoft/wslg/issues/446)\n\nFree and Open source projects:\n\n* [musl libc](https://git.musl-libc.org/cgit/musl)\n* [ArchLinux's mkinitcpio](https://github.com/archlinux/mkinitcpio)\n\n## License\n\nThis project is licensed under GNU General Public License version 3 or any later\nversion at your option. See [LICENSE](LICENSE) file for further details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiswa96%2Finitrdg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiswa96%2Finitrdg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiswa96%2Finitrdg/lists"}