You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Distrobox创建Ubuntu 23.04容器后无法设置密码及执行sudo命令求助

Distrobox创建Ubuntu 23.04容器后无法设置密码及执行sudo命令求助

我之前发的帖子没人回应还被降赞了,只好再试一次。我用Distrobox搭建了Ubuntu 23.04的容器,但现在没办法设置密码,因此也没法执行任何sudo命令。以下是我创建并进入容器的完整过程,用户密码并没有继承主机系统的设置,我觉得问题可能出在这两行警告里:

Warning: there was a problem setting up the user
Warning: trying manual addition [ OK ]

希望能得到大家的帮助,非常感谢!

终端操作及输出记录

(deck@steamdeck ~)$ distrobox create --image ubuntu:23.04 --name ubuntu

Creating 'ubuntu' using image ubuntu:23.04       [ OK ]

Distrobox 'ubuntu' successfully created.

To enter, run:

distrobox enter ubuntu

(deck@steamdeck ~)$ distrobox enter ubuntu

Container ubuntu is not running.

Starting container ubuntu

run this command to follow along:

podman logs -f ubuntu

Starting container...                           [ OK ]

Installing basic packages...                    [ OK ]

Setting up read-only mounts...                  [ OK ]

Setting up read-write mounts...                 [ OK ]

Setting up host's sockets integration...        [ OK ]

Integrating host's themes, icons, fonts...      [ OK ]

Setting up package manager exceptions...        [ OK ]

Setting up dpkg exceptions...                   [ OK ]

Setting up apt hooks...                         [ OK ]

Setting up sudo...                              [ OK ]

Setting up groups...                            [ OK ]

Integrating host's themes, icons, fonts...      [ OK ]

Setting up package manager exceptions...        [ OK ]

Setting up dpkg exceptions...                   [ OK ]

Setting up apt hooks...                         [ OK ]

Setting up sudo...                              [ OK ]

Setting up groups...                            [ OK ]

Setting up users...

Warning: there was a problem setting up the user

Warning: trying manual addition [ OK ]

Executing init hooks...                         [ OK ]

Container Setup Complete!

bash: xhost: command not found

ubuntu@ubuntu:~$ sudo apt update

[sudo] password for ubuntu:

Sorry, try again.

[sudo] password for ubuntu:

备注:内容来源于stack exchange,提问作者BioGuy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.21 14:53:18