目錄
一、前言
二、具體解決方法
第一步:切換root用戶至自己賬號(hào)
第二步:重新安裝xrdp
第三步:重新配置端口并啟動(dòng)xrdp
第四步:打開(kāi)遠(yuǎn)程連接窗口
第五步:點(diǎn)擊連接,開(kāi)始進(jìn)入Linux子系統(tǒng)?編輯
第六步:切換到的賬戶的輸入密碼,并點(diǎn)擊認(rèn)證
?第七步:成功進(jìn)入U(xiǎn)buntu20.04?
?三、尾言
一、前言
? ? ? ? 由于研究方向是無(wú)人機(jī)路徑規(guī)劃需要用到ros機(jī)器人操作系統(tǒng),我就在Win11系統(tǒng)的電腦上安裝了一個(gè)Ubuntu20.04LTS版本的Linux子系統(tǒng)。之后我在打開(kāi)linux子系統(tǒng)的情況下把自己的win11主系統(tǒng)給關(guān)機(jī)了,后來(lái)再把電腦開(kāi)機(jī)通過(guò)遠(yuǎn)程桌面連接去訪問(wèn)Linux子系統(tǒng)時(shí)出現(xiàn)了下面的錯(cuò)誤:
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: 主機(jī)關(guān)閉
二、具體解決方法
按照下面的操作就行了:?
第一步:切換root用戶至自己賬號(hào)
自己賬號(hào)就是安裝ubuntu20.04時(shí)自己創(chuàng)建的那個(gè)用戶賬號(hào)
運(yùn)行命令:
root@LAPTOP-S0G7C3PS:~# su renlinchao
?現(xiàn)象:
Sleeping for 1 second to let systemd settle
Welcome to Ubuntu 20.04.5 LTS (GNU/Linux 5.10.16.3-microsoft-standard-WSL2 x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of 2022年 10月 15日 星期六 19:28:27 CST
System load: 0.0 Processes: 44
Usage of /: 4.8% of 250.98GB Users logged in: 0
Memory usage: 5% IPv4 address for eth0: 172.27.54.91
Swap usage: 0%
* Super-optimized for small spaces - read how we shrank the memory
footprint of MicroK8s to make it the smallest full K8s around.
https://ubuntu.com/blog/microk8s-memory-optimisation
0 更新可以立即應(yīng)用。
第二步:重新安裝xrdp
sudo apt-get install xrdp
現(xiàn)象:
[sudo] renlinchao 的密碼:
正在讀取軟件包列表... 完成
正在分析軟件包的依賴關(guān)系樹(shù)
正在讀取狀態(tài)信息... 完成
xrdp 已經(jīng)是最新版 (0.9.12-1)。
升級(jí)了 0 個(gè)軟件包,新安裝了 0 個(gè)軟件包,要卸載 0 個(gè)軟件包,有 0 個(gè)軟件包未被升級(jí)。
第三步:重新配置端口并啟動(dòng)xrdp
運(yùn)行命令:
sudo sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini
echo "gnome-session" > ~/.xsession
sudo systemctl restart xrdp
sudo systemctl status xrdp
現(xiàn)象:
● xrdp.service - xrdp daemon
Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2022-10-15 20:55:15 CST; 8s ago
Docs: man:xrdp(8)
man:xrdp.ini(5)
Process: 570 ExecStartPre=/bin/sh /usr/share/xrdp/socksetup (code=exited, status=0/SUCCESS)
Process: 578 ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 579 (xrdp)
Tasks: 1 (limit: 4634)
Memory: 1.2M
CGroup: /system.slice/xrdp.service
└─579 /usr/sbin/xrdp
Oct 15 20:55:14 LAPTOP-S0G7C3PS xrdp[578]: (578)(139874801551168)[INFO ] address [0.0.0.0] port [3390] mode 1
Oct 15 20:55:14 LAPTOP-S0G7C3PS xrdp[578]: (578)(139874801551168)[INFO ] listening to port 3390 on 0.0.0.0
Oct 15 20:55:14 LAPTOP-S0G7C3PS xrdp[578]: (578)(139874801551168)[INFO ] xrdp_listen_pp done
Oct 15 20:55:14 LAPTOP-S0G7C3PS xrdp[578]: (578)(139874801551168)[DEBUG] Closed socket 7 (AF_INET6 :: port 3390)
Oct 15 20:55:14 LAPTOP-S0G7C3PS systemd[1]: xrdp.service: Can't open PID file /run/xrdp/xrdp.pid (yet?) after start: 不>Oct 15 20:55:15 LAPTOP-S0G7C3PS systemd[1]: Started xrdp daemon.
Oct 15 20:55:16 LAPTOP-S0G7C3PS xrdp[579]: (579)(139874801551168)[INFO ] starting xrdp with pid 579
Oct 15 20:55:16 LAPTOP-S0G7C3PS xrdp[579]: (579)(139874801551168)[INFO ] address [0.0.0.0] port [3390] mode 1
Oct 15 20:55:16 LAPTOP-S0G7C3PS xrdp[579]: (579)(139874801551168)[INFO ] listening to port 3390 on 0.0.0.0
Oct 15 20:55:16 LAPTOP-S0G7C3PS xrdp[579]: (579)(139874801551168)[INFO ] xrdp_listen_pp done
lines 1-23/23 (END)...skipping...
● xrdp.service - xrdp daemon
Loaded: loaded (/lib/systemd/system/xrdp.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2022-10-15 20:55:15 CST; 8s ago
Docs: man:xrdp(8)
man:xrdp.ini(5)
Process: 570 ExecStartPre=/bin/sh /usr/share/xrdp/socksetup (code=exited, status=0/SUCCESS)
Process: 578 ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 579 (xrdp)
Tasks: 1 (limit: 4634)
Memory: 1.2M
CGroup: /system.slice/xrdp.service
└─579 /usr/sbin/xrdp
Oct 15 20:55:14 LAPTOP-S0G7C3PS xrdp[578]: (578)(139874801551168)[INFO ] address [0.0.0.0] port [3390] mode 1
Oct 15 20:55:14 LAPTOP-S0G7C3PS xrdp[578]: (578)(139874801551168)[INFO ] listening to port 3390 on 0.0.0.0
Oct 15 20:55:14 LAPTOP-S0G7C3PS xrdp[578]: (578)(139874801551168)[INFO ] xrdp_listen_pp done
Oct 15 20:55:14 LAPTOP-S0G7C3PS xrdp[578]: (578)(139874801551168)[DEBUG] Closed socket 7 (AF_INET6 :: port 3390)
Oct 15 20:55:14 LAPTOP-S0G7C3PS systemd[1]: xrdp.service: Can't open PID file /run/xrdp/xrdp.pid (yet?) after start: 不 允許的操作
Oct 15 20:55:15 LAPTOP-S0G7C3PS systemd[1]: Started xrdp daemon.
Oct 15 20:55:16 LAPTOP-S0G7C3PS xrdp[579]: (579)(139874801551168)[INFO ] starting xrdp with pid 579
Oct 15 20:55:16 LAPTOP-S0G7C3PS xrdp[579]: (579)(139874801551168)[INFO ] address [0.0.0.0] port [3390] mode 1
Oct 15 20:55:16 LAPTOP-S0G7C3PS xrdp[579]: (579)(139874801551168)[INFO ] listening to port 3390 on 0.0.0.0
Oct 15 20:55:16 LAPTOP-S0G7C3PS xrdp[579]: (579)(139874801551168)[INFO ] xrdp_listen_pp done
第四步:打開(kāi)遠(yuǎn)程連接窗口
第五步:點(diǎn)擊連接,開(kāi)始進(jìn)入Linux子系統(tǒng)
第六步:切換到的賬戶的輸入密碼,并點(diǎn)擊認(rèn)證
?第七步:成功進(jìn)入U(xiǎn)buntu20.04?
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-595552.html
?三、尾言
? ? ? ? ?嘗試新事物重新各種各樣的錯(cuò)誤是肯定的,出現(xiàn)某種錯(cuò)誤的原因也是多種多樣的,如果上面的流程沒(méi)有解決你的問(wèn)題可以下面留言或者直接加我微信問(wèn)我都是可以的,都是免費(fèi)的,學(xué)技術(shù)問(wèn)人不丟人,關(guān)鍵是要知道去學(xué),不要讓自己的大學(xué)四年或者研究生三年白白浪費(fèi)了。文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-595552.html
到了這里,關(guān)于win11安裝的Ubuntu20.04子系統(tǒng)出現(xiàn)System has not been booted with systemd as init system (PID 1)問(wèn)題的解決流程的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!