mishamosher / centos-wsl Goto Github PK
View Code? Open in Web Editor NEWA GitHub Actions automated CentOS RootFS to use with WSL
License: MIT License
A GitHub Actions automated CentOS RootFS to use with WSL
License: MIT License
Following the tips on the network, I created file /etc/wsl.conf
and write the content below to change default user to jerrfy
[user]
xxxxdefaultuser=jerrfy # maybe this, I can't remember any longer
After configuring this file , the centos8 distribution use jerrfy to login as default, but soon I found the problem, I cannot use root account, and the jerrfy account has no previllege of root, and the account cannot switch to root no more, so does there has any solutions to config the root account and reuse it?
Hi,sir!
I would like to ask a question, I used to install centos6.exe, but when I open centos6 in cmd, it can not enter the system, there will be a report error,
(Processing fstab with mount -a failed.)
I installed centos7, 8 are no problem, because some need I need to install centos6
First of all, awesome work on creating this for WSL. Really really useful, thank you.
I am following instructions given in here to install MariaDB on CentOS7 for WSL in Windows 11.
PS C:\Users\joe> wsl -l -v
NAME STATE VERSION
* Ubuntu-22.04 Stopped 2
docker-desktop Running 2
docker-desktop-data Stopped 2
CentOS7 Stopped 2
sudo yum install mariadb-server
works with no problems as expected. However, sudo systemctl start mariadb
will run into the following issue:
[root@mycomputer etc]# systemctl start mariadb
Failed to get D-Bus connection: Operation not permitted
So I enabled systemd
by adding the following to /etc/wsl.conf
[boot]
systemd=true
I shutdown wsl
and restarted it. systemctl list-units --type=service
will produce the proper results indicating systemd
is working. However, I am still getting Failed to get D-Bus connection
.
Is there any way to get MariaDB server to work in CentOS 7 for WSL?
Just as the title says. On CentOS8-Stream the WSL Environment will not start without launching it manually from PowerShell. This was most likely caused from downgrading from WSL 2 to WSL 1 after the install of the CentOS8-stream Distribution.
PS C:\WINDOWS\system32> wsl -d CentOS8-stream
nsenter: cannot open /proc/43/ns/cgroup: No such file or directory
PS C:\WINDOWS\system32> wsl -d CentOS8-stream --exec "/usr/bin/zsh"
λ ~ whoami
root
λ ~ exit
PS C:\WINDOWS\system32>
The same thing still happens even when WSL is restarted
PS C:\Program Files\WSL\CentOS8-Stream> wsl --terminate CentOS8-stream
PS C:\Program Files\WSL\CentOS8-Stream> wsl -d CentOS8-stream
nsenter: cannot open /proc/43/ns/cgroup: No such file or directory
PS C:\Program Files\WSL\CentOS8-Stream> wsl --shutdown
PS C:\Program Files\WSL\CentOS8-Stream> wsl -d CentOS8-stream
nsenter: cannot open /proc/43/ns/cgroup: No such file or directory
PS C:\Program Files\WSL\CentOS8-Stream>
Here is all of my WSL Distros that are installed.
PS C:\WINDOWS\system32> wsl --list --verbose
NAME STATE VERSION
* CentOS8-stream Running 1
docker-desktop-data Stopped 2
docker-desktop Stopped 2
PS C:\WINDOWS\system32>
And the MD5 of CentOS8-stream.exe
PS C:\Program Files\WSL\CentOS8-Stream> md5sum.exe .\CentOS8-stream.exe
\7139b98cba53182371bc8d20a3b34c72 *.\\CentOS8-stream.exe
To prevent me from doing something foolish, I would like to launch CentOS with a non-root account. Is this setting "visible" in the builds?
Hi - thanks @mishamosher for sharing your prebuild wsl images.
Is it possible for you to share how your ci/cd is for converting the QCOW2 files, to wsl images? Any writeup or repo which could be read?
Thanks.
cannot start a program using systemctl
pls delete /etc/resolv.conf
file, for its automatically generation by WSL like microsoft offical Ubuntu 20.04 does. Refer https://github.com/microsoft/WSL-DistroLauncher/blob/2ed9a9335fc89a688a5150c95eff4fbdbc830f25/DistroLauncher/DistroLauncher.cpp#L32
Your CentOS9 does not seem to recognize systemctl and service
By the way, do you want something else like Ubuntu-WSL
# dnf update
CentOS Stream 9 - BaseOS 1.4 MB/s | 5.8 MB 00:04
CentOS Stream 9 - AppStream 5.4 MB/s | 15 MB 00:02
CentOS Stream 9 - Extras packages 7.0 kB/s | 8.5 kB 00:01
Dependencies resolved.
============================================================================ Package Arch Version Repository Size
============================================================================Installing:
kernel x86_64 5.14.0-134.el9 baseos 1.5 M
Upgrading:
NetworkManager x86_64 1:1.39.10-1.el9 baseos 2.1 M
NetworkManager-libnm x86_64 1:1.39.10-1.el9 baseos 1.7 M
NetworkManager-team x86_64 1:1.39.10-1.el9 baseos 36 k
NetworkManager-tui x86_64 1:1.39.10-1.el9 baseos 229 k
ca-certificates noarch 2022.2.54-90.0.el9 baseos 856 k
cockpit-bridge x86_64 273-1.el9 baseos 269 k
cockpit-system noarch 273-1.el9 baseos 3.6 M
cockpit-ws x86_64 273-1.el9 baseos 783 k
dhcp-client x86_64 12:4.4.2-17.b1.el9 baseos 790 k
dhcp-common noarch 12:4.4.2-17.b1.el9 baseos 129 k
dracut x86_64 057-10.git20220721.el9 baseos 452 k
dracut-config-generic x86_64 057-10.git20220721.el9 baseos 11 k
dracut-network x86_64 057-10.git20220721.el9 baseos 79 k
dracut-squash x86_64 057-10.git20220721.el9 baseos 12 k
kernel-tools x86_64 5.14.0-134.el9 baseos 1.7 M
kernel-tools-libs x86_64 5.14.0-134.el9 baseos 1.5 M
kexec-tools x86_64 2.0.24-5.el9 baseos 480 k
libselinux x86_64 3.4-3.el9 baseos 86 k
libselinux-utils x86_64 3.4-3.el9 baseos 182 k
lshw x86_64 B.02.19.2-9.el9 baseos 328 k
openssl x86_64 1:3.0.1-38.el9 baseos 1.2 M
openssl-libs x86_64 1:3.0.1-38.el9 baseos 2.1 M
python3-libselinux x86_64 3.4-3.el9 appstream 186 k
selinux-policy noarch 34.1.38-1.el9 baseos 62 k
selinux-policy-targeted noarch 34.1.38-1.el9 baseos 6.7 M
setup noarch 2.13.7-7.el9 baseos 146 k
Installing dependencies:
kernel-core x86_64 5.14.0-134.el9 baseos 45 M
kernel-modules x86_64 5.14.0-134.el9 baseos 32 M
Transaction Summary
============================================================================Install 3 Packages
Upgrade 26 Packages
Total download size: 104 M
Is this ok [y/N]: y
Downloading Packages:
(1/29): kernel-5.14.0-134.el9.x86_64.rpm 1.9 MB/s | 1.5 MB 00:00
(2/29): NetworkManager-1.39.10-1.el9.x86_64 6.0 MB/s | 2.1 MB 00:00
(3/29): NetworkManager-libnm-1.39.10-1.el9. 4.9 MB/s | 1.7 MB 00:00
(4/29): NetworkManager-team-1.39.10-1.el9.x 463 kB/s | 36 kB 00:00
(5/29): NetworkManager-tui-1.39.10-1.el9.x8 2.1 MB/s | 229 kB 00:00
(6/29): ca-certificates-2022.2.54-90.0.el9. 4.0 MB/s | 856 kB 00:00
(7/29): cockpit-bridge-273-1.el9.x86_64.rpm 2.4 MB/s | 269 kB 00:00
(8/29): cockpit-system-273-1.el9.noarch.rpm 6.0 MB/s | 3.6 MB 00:00
(9/29): cockpit-ws-273-1.el9.x86_64.rpm 5.5 MB/s | 783 kB 00:00
(10/29): dhcp-client-4.4.2-17.b1.el9.x86_64 4.7 MB/s | 790 kB 00:00
(11/29): dhcp-common-4.4.2-17.b1.el9.noarch 1.3 MB/s | 129 kB 00:00
(12/29): dracut-057-10.git20220721.el9.x86_ 4.3 MB/s | 452 kB 00:00
(13/29): dracut-config-generic-057-10.git20 178 kB/s | 11 kB 00:00
(14/29): dracut-network-057-10.git20220721. 958 kB/s | 79 kB 00:00
(15/29): kernel-modules-5.14.0-134.el9.x86_ 8.6 MB/s | 32 MB 00:03
(16/29): dracut-squash-057-10.git20220721.e 25 kB/s | 12 kB 00:00
(17/29): kernel-tools-5.14.0-134.el9.x86_64 4.7 MB/s | 1.7 MB 00:00
(18/29): kernel-tools-libs-5.14.0-134.el9.x 3.8 MB/s | 1.5 MB 00:00
(19/29): kexec-tools-2.0.24-5.el9.x86_64.rp 4.3 MB/s | 480 kB 00:00
(20/29): libselinux-3.4-3.el9.x86_64.rpm 1.0 MB/s | 86 kB 00:00
(21/29): libselinux-utils-3.4-3.el9.x86_64. 2.5 MB/s | 182 kB 00:00
(22/29): lshw-B.02.19.2-9.el9.x86_64.rpm 3.4 MB/s | 328 kB 00:00
(23/29): openssl-3.0.1-38.el9.x86_64.rpm 5.4 MB/s | 1.2 MB 00:00
(24/29): openssl-libs-3.0.1-38.el9.x86_64.r 8.7 MB/s | 2.1 MB 00:00
(25/29): selinux-policy-34.1.38-1.el9.noarc 841 kB/s | 62 kB 00:00
(26/29): setup-2.13.7-7.el9.noarch.rpm 1.9 MB/s | 146 kB 00:00
(27/29): python3-libselinux-3.4-3.el9.x86_6 2.3 MB/s | 186 kB 00:00
(28/29): kernel-core-5.14.0-134.el9.x86_64. 7.3 MB/s | 45 MB 00:06
(29/29): selinux-policy-targeted-34.1.38-1. 4.2 MB/s | 6.7 MB 00:01
----------------------------------------------------------------------------Total 13 MB/s | 104 MB 00:08
CentOS Stream 9 - BaseOS 1.6 MB/s | 1.6 kB 00:00
Importing GPG key 0x8483C65D:
Userid : "CentOS (CentOS Official Signing Key) <[email protected]>"
Fingerprint: 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Is this ok [y/N]: y
Key imported successfully
error: sqlite failure: CREATE TABLE IF NOT EXISTS 'Packages' (hnum INTEGER PRIMARY KEY AUTOINCREMENT,blob BLOB NOT NULL): locking protocol
error: cannot open Packages index using sqlite - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
Import of key(s) didn't help, wrong key(s)?
error: sqlite failure: CREATE TABLE IF NOT EXISTS 'Packages' (hnum INTEGER PRIMARY KEY AUTOINCREMENT,blob BLOB NOT NULL): locking protocol
error: cannot open Packages index using sqlite - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
error: sqlite failure: CREATE TABLE IF NOT EXISTS 'Packages' (hnum INTEGER PRIMARY KEY AUTOINCREMENT,blob BLOB NOT NULL): locking protocol
error: cannot open Packages index using sqlite - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
error: sqlite failure: CREATE TABLE IF NOT EXISTS 'Packages' (hnum INTEGER PRIMARY KEY AUTOINCREMENT,blob BLOB NOT NULL): locking protocol
error: cannot open Packages index using sqlite - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
error: sqlite failure: CREATE TABLE IF NOT EXISTS 'Packages' (hnum INTEGER PRIMARY KEY AUTOINCREMENT,blob BLOB NOT NULL): locking protocol
error: cannot open Packages index using sqlite - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
error: sqlite failure: CREATE TABLE IF NOT EXISTS 'Packages' (hnum INTEGER PRIMARY KEY AUTOINCREMENT,blob BLOB NOT NULL): locking protocol
error: cannot open Packages index using sqlite - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
error: sqlite failure: CREATE TABLE IF NOT EXISTS 'Packages' (hnum INTEGER PRIMARY KEY AUTOINCREMENT,blob BLOB NOT NULL): locking protocol
error: cannot open Packages index using sqlite - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
error: sqlite failure: CREATE TABLE IF NOT EXISTS 'Packages' (hnum INTEGER PRIMARY KEY AUTOINCREMENT,blob BLOB NOT NULL): locking protocol
error: cannot open Packages index using sqlite - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
error: sqlite failure: CREATE TABLE IF NOT EXISTS 'Packages' (hnum INTEGER PRIMARY KEY AUTOINCREMENT,blob BLOB NOT NULL): locking protocol
error: cannot open Packages index using sqlite - No such file or directory (2)
error: cannot open Packages database in /var/lib/rpm
Killed
I found that when running it with WSL2, systemd is not used.
There needs to be a wsl.conf in /etc
[boot]
systemd=true
Then restart. You can use systemed
Why not add this configuration file? It is for wsl anyway.
Sometimes I want to view files in centos on windows ❤️
After first successful installation, I can enter the terminal using CentOS.exe.
Then I want to see if I can move the folder, so I move it from desktop (C:\Users\nitromelon\Desktop\CentOS8) to another place ( X:\CentOS8).
After moving, running CentOS8.exe will get stuck forever. I tried deleting all files, rebooting my system, and unzip CentOS8.zip again, but it still gets stuck when running CentOS8.exe
What should I do now?
When I run netstat -g
, it shows "netstat: no support for `AF INET (igmp)' on this system", which means igmp/multicast is not compiled in this kernel, can you recompiled a new kernel for wsl CentOS7?
Just a Question ?
CentOS Stream 10 is released, is there any plan for it on wsl?
When I run CentOS6.exe
it fails with
ERROR:[234] Could not read registry key
ERROR:[234] Could not read registry key
I can only run it with a cable network,but can run without internet or via WI-FI
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.