大网数据广告活动
服务器运维问答

How can I launch gparted in centos 7 minimal

· 52CE 我爱测

I have already installed gparted because I want resize some partitions on a box running centos 7 minimal. So I can ssh into the box and only have access to the terminal. I run the command gaprted to try and start it but it says: …

问题原文

原帖链接 · Joey Corkey · CC BY-SA 3.0

I have already installed gparted because I want resize some partitions on a box running centos 7 minimal. So I can ssh into the box and only have access to the terminal.

I run the command gaprted to try and start it but it says:

(gpartedbin:23033): Gtk-WARNING **: cannot open display:

How can I start gparted so the actaully GUI will appear so I can resize partitions through the GUI??

已采纳解答

原帖链接 · telcoM · CC BY-SA 3.0

If you've installed gparted using a package manager, it has pulled any necessary X11 and GNOME libraries along with it as dependencies. You may need to install the xauth package separately.

So, if you want to use gparted GUI, you'll need to have a X11 server running on the system that has your physical display, keyboard and mouse, and then establish a SSH connection with X11 forwarding enabled. This will allow gparted to send its GUI back along the SSH connection to your local system, where the X11 server will draw it onto your local display.

For Windows, VcXsrv is a reasonably up-to-date free X11 server software that is fairly easy to install. For use with SSH X11 forwarding, you don't typically have to configure it in any way: just make sure it's started before you start your SSH client, and make sure X11 forwarding has been enabled in your SSH client options.

The first time you establish a SSH connection with X11 forwarding, there should be a message like:

/usr/bin/xauth:  file /root/.Xauthority does not exist

This indicates sshd at the remote host is using xauth to prepare the connection, but since this is the first time, the .Xauthority file in your home directory won't exist yet. This is normally just an informational message: the xauth tool will automatically create the file if it does not exist.

In order to modify partitions using a X11 GUI tool, you'll need root permissions, so it will be simplest if you can log in directly as root. If that is not possible, you can log in as some other user, run echo $DISPLAY to view the value of the DISPLAY environment variable, then switch to root user and make sure the DISPLAY variable is still set to the same value (re-set it if necessary). You will also need to set the XAUTHORITYenvironment variable to point to the .Xauthority file in your original home directory, i.e. something like

export XAUTHORITY=/home/<username>/.Xauthority

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-12-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。