SSH通过X11协议在Linux服务器运行GUI程序
最近在VPS上用到的一个GUI程序,没想到在无桌面环境下的Linux系统也能运行。网上搜索了解了一番,其原理是通过X11协议实现的,需要在本机及服务器两端安装软件支持。下面演示下运行方法。
SSH客户端配置
SSH客户端不能直接呈现图形界面,需要安装Xming软件配合。
安装后在开始菜单程序文件夹里打开XLaunch,设置依次默认下一步,直到这个界面勾选NO ACCESS CONTROL
选项保存退出。
之后打开SSH客户端会话设置,勾选X11转发选项。笔者这里用的是SecureCRT。PuTTY设置里也有相关选项。Xshell未测试,据说要安装Xmanager。
到此SSH客户端设置完成。如果你没用上面SSH客户端,可以使用MobaXterm,它内置X11支持。
服务器配置
先交代服务器环境为CentOS 7 x64(Minimal)。如果直接运行GUI程序,通常会有如下报错。
[root@test ~]# ./FileName ./FileName: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory
这个问题可以通过yum install -y gtk2
解决。
再次运行提示Gtk-WARNING **: cannot open display
错误,需要安装X11相关软件。
yum install -y xorg-x11-xauth xorg-x11-fonts-* xorg-x11-font-utils xorg-x11-fonts-Type1
之后再修改/etc/ssh/sshd_config
文件,确保下面两个参数值改为如下。
X11Forwarding yes X11UseLocalhost no
systemctl restart sshd
刷新SSH配置文件,退出终端重新登录。
重新登录有个/root/.Xauthority
文件缺失错误,不用理会,它会自动创建,下次登录就不会提示。
运行GUI程序
运行个GUI程序试试,例如xclock时钟。先yum install -y xclock
安装,然后运行xclock
命令。
如无意外,就会显示图形界面了(记得先打开之前安装的Xming程序)。
再运行个Chromium浏览器测试,用下面命令安装,然后chromium-browser --no-sandbox
命令运行。
yum install epel-release yum -y install chromium
如果程序界面里的文字显示乱码,运行下面命令安装字体重试。
yum install -y dejavu-sans-mono-fonts wqy-zenhei-fonts
参考及延伸资料:
- https://zeroto.one/2018/08/13/linux_x11_config/
- https://www.cnblogs.com/tsfh/p/9022170.html
- http://blog.creke.net/810.html
Hi, very nice website, cheers!
——————————————————
Need cheap and reliable hosting? Our shared plans start at $10 for an year and VPS plans for $6/Mo.
——————————————————
Check here: https://www.reliable-webhosting.com/
generic bimatoprost samples https://carepro1st.com/
naltrexone webmd https://naltrexoneonline.confrancisyalgomas.com/
active ingredients in hydroxychloroquine https://hhydroxychloroquine.com/
ivermectin pills instruction https://ivermectin.mlsmalta.com/
dapoxetine citrate for sale https://salemeds24.wixsite.com/dapoxetine
hydroxychloroquine dosage for coronavirus https://hydroxychloroquine.webbfenix.com/
which is better viagra levitra or vidalista https://vidalista40mg.mlsmalta.com/
online doctors prescribe pain medications https://buymeds.mlsmalta.com/
chewable tadalafil https://wisig.org/
what dosage of hydroxychloroquine for covid https://hydroxychloroquinee.com/
best price for priligy https://ddapoxetine.com/
difference between albuterol and proair https://amstyles.com/
alternatives to prednisone for asthma https://prednisone.bvsinfotech.com/
compare cialis prices https://www.lm360.us/
professional generic viagra 100mg https://viaplz.com/
cenforce 200 sildenafil citrate reviews http://droga5.net/
hydroxychloroquine for covid 19 dosage https://hydroxychloroquine.wisig.org/
hydroxychloroquine for covid 19 dosage https://hydroxychloroquine.grassfed.us/
instant approval loans
kamagra uk paypal
prozac pill
vardenafil cost canada
microloans
viagra 100mg cost in usa
need a loan immediately
payday loan sites
loan without a job
how long does cialis last https://cialis.advantagetriseal.com/
how long does cialis last https://cialis.grassfed.us/
generic viagra online paypal
loans unsecured
flomax otc
instant personal loan approval
payday advance lenders
generic viagra paypal canada
canadian pharmacy tadalafil
negative effects of cialis https://cialis.mlsmalta.com/
negative effects of cialis https://cialis.webbfenix.com/
Fastidious answers in return of this matter with solid arguments and
explaining all concerning that.
my web site: google
Thanks in favor of sharing such a nice thought, post is nice, thats why i have read it fully
Feel free to surf to my website – download albums free zip (Virgilio)
Hello there, You’ve done an excellent job. I’ll definitely digg it and
personally recommend to my friends. I’m sure they’ll be benefited from this site.
Here is my site google
I seriously love your website.. Very nice colors & theme.
Did you develop this amazing site yourself? Please reply back as I’m trying to create my very own website and
would love to find out where you got this from or what the theme is named.
Many thanks!
Feel free to visit my blog hurdacı istanbul
pour on stromectol https://ivermectin1st.com/
Thank you for every other informative web site. The place else may just I am getting that kind of info written in such an ideal method?
I have a venture that I am just now working on, and I have been at the glance out for such information.
Feel free to visit my blog – security guards wigan
Neat blog! Is your theme custom made or did you download it from somewhere?
A design like yours with a few simple tweeks
would really make my blog jump out. Please let me know where you got your design.
Many thanks
my web blog :: riverwalk apartments philly (Catharine)
whoah this weblog is wonderful i like studying your posts.
Stay up the good work! You understand, lots of individuals
are looking around for this info, you could aid them greatly.
Feel free to surf to my blog post :: Ayurvedic Massage in Sharjah
Link exchange is nothing else however it is just
placing the other person’s webpage link on your page at
appropriate place and other person will also do same in support of you.
Feel free to visit my blog: water wave virgin hair
It’s hard to search out knowledgeable people on this matter, however you sound like you know what you’re talking about! Thanks
http://www.vreyrolinomit.com/
Fantastic post but I was wondering if you could write a litte more on this topic?
I’d be very grateful if you could elaborate a little bit
more. Many thanks!
my page: New South Wales Fake Driver licence
I just like the helpful information you supply in your articles.
I’ll bookmark your weblog and take a look at
once more right here frequently. I’m relatively sure I’ll be informed many new stuff proper here!
Good luck for the next!
Feel free to visit my web page; Herman Miller (Mattie)
Right here is the right blog for anybody who really wants to understand
this topic. You know a whole lot its almost hard to argue
with you (not that I really will need to…HaHa).
You definitely put a new spin on a subject that has been written about for many years.
Excellent stuff, just excellent!
my site; office furniture liquidation
I’m truly enjoying the design and layout of your blog.
It’s a very easy on the eyes which makes it much more pleasant for me
to come here and visit more often. Did you hire out a designer to
create your theme? Fantastic work!
my page: Brake Replacement (marketing-agency58158.is-blog.com)
This piece of writing will help the internet users for
creating new weblog or even a weblog from start to end.
Feel free to visit my web-site :: كشف منزلي
Wow, amazing blog layout! How long have you been blogging
for? you made blogging look easy. The overall look of your web site
is wonderful, as well as the content!
my web blog :: scheduling a road test (http://jeffreydytmg.blue-blogs.com/3383819/driving-license-exams-choosing-the-greatest-online-instruction-service-provider)
Hello there, You’ve done a fantastic job.
I’ll certainly digg it and personally recommend to my friends.
I am confident they’ll be benefited from this web site.
Here is my webpage :: Online delivery sri lanka (Hector)
Link exchange is nothing else however it is simply placing the other person’s web
site link on your page at appropriate place and other person will
also do similar in support of you.
Look into my webpage … property development loans
I feel that is one of the so much important info for me.
And i’m glad studying your article. However should statement on some general issues, The website style is
perfect, the articles is truly nice : D. Excellent
process, cheers
Stop by my page; furniture in kuwait
Sweet blog! I found it while searching on Yahoo News.
Do you have any tips on how to get listed in Yahoo News?
I’ve been trying for a while but I never seem to get there!
Cheers
Feel free to surf to my page: check my blog; Katherine,
I always spent my half an hour to read this
blog’s posts daily along with a mug of coffee.
Here is my blog post :: best xmind alternative
I have been exploring for a little for any high quality
articles or blog posts on this kind of house .
Exploring in Yahoo I eventually stumbled upon this web site.
Reading this info So i’m glad to exhibit that I have an incredibly just right uncanny feeling
I came upon just what I needed. I so much undoubtedly will make certain to do not forget
this website and provides it a look on a relentless basis.
Feel free to visit my web page – RC Truck Trial Unimog (writeablog.net)
I’m impressed, I have to admit. Seldom do I come across a blog that’s equally educative and interesting, and let me tell you, you’ve hit the nail on the head.
The problem is something that too few folks are speaking intelligently about.
I’m very happy that I came across this in my hunt for something regarding this.
Have a look at my web blog – Bangladesh Newspapers (Juan)
Nice weblog here! Also your web site rather a lot up fast!
What web host are you the use of? Can I get your associate hyperlink on your host?
I desire my site loaded up as quickly as yours lol
Here is my homepage Loft Conversions Rochdale
If you wish for to obtain much from this article then you have to apply these techniques to
your won webpage.
My web blog – Assistencia (http://www.assist24.pt)
I have been browsing online more than 4 hours today,
yet I never found any interesting article like yours.
It is pretty worth enough for me. In my view, if all web owners and bloggers made good
content as you did, the internet will be a lot more useful than ever before.
My webpage :: HP indonesia (http://internet-marketing-compan73849.loginblogin.com/3599393/benefits-of-using-a-mobile-phone-skin)
Do you have any video of that? I’d love to find out some additional information.
Take a look at my web-site: Homes for sale in Saratoga Springs
NY (Shelley)
There’s certainly a great deal to learn about this topic.
I love all the points you made.
Here is my web page :: self help
Howdy just wanted to give you a quick heads up.
The words in your article seem to be running off the screen in Ie.
I’m not sure if this is a format issue or something to do with web browser compatibility but I thought
I’d post to let you know. The style and design look great though!
Hope you get the problem solved soon. Thanks
Here is my page … radiator core
Appreciate the recommendation. Let me try it out.
Feel free to surf to my blog :: replica designer shoes [Eileen]
cialis brand online http://edbuy.online/
I could not refrain from commenting. Well written!
Feel free to surf to my webpage … Ammie Vahle
Hi, of course this post is in fact fastidious and I have
learned lot of things from it concerning blogging. thanks.
Feel free to visit my web blog Chaya Palencia
Hello there, just became alert to your blog through Google,
and found that it’s really informative. I’m gonna watch out
for brussels. I’ll be grateful if you continue this in future.
A lot of people will be benefited from your writing. Cheers!
Look at my web site; Teressa Fenimore (Dana)
I like what you guys are up too. Such smart work and reporting! Carry on the excellent works guys I’ve incorporated you guys to my blogroll. I think it’ll improve the value of my web site 🙂
http://www.zortilonrel.com/
Thanks designed for sharing such a pleasant idea, paragraph is fastidious, thats why i have
read it fully
My web-site – Rodger Romanik
Truly when someone doesn’t know after that its up to other people that they will help,
so here it occurs.
Also visit my webpage Keshia Dake; http://stocks.newsok.com/,
I’m not sure why but this weblog is loading
extremely slow for me. Is anyone else having this issue or is it a
problem on my end? I’ll check back later on and see if the problem still exists.
Feel free to surf to my web blog; Merle Landes
It’s hard to come by educated people about this topic, but you sound
like you know what you’re talking about! Thanks
Visit my web blog; grill kabob express manassas va
Excellent post. I was checking continuously this blog and I’m impressed!
Very helpful information specifically the last part 🙂 I care for such info a lot.
I was seeking this certain info for a long time. Thank you and good luck.
Here is my web page – grill dinner ideas
me encantei com este site. Para saber mais detalhes acesse nosso site e descubra mais. Todas as informações contidas são informações relevantes e únicos. Tudo que você precisa saber está está lá.
https://corporality.global/
I got this web page from my friend who told me concerning
this web page and now this time I am browsing this web site
and reading very informative articles at this time.
my blog … Araceli Gibby
Greetings! Very helpful advice within this article!
It is the little changes which will make the largest changes.
Thanks a lot for sharing!
Also visit my web page; Erna Stoney
Yes! Finally something about artigianato sardo.
Visit my web-site artigianato in costa smeralda; artigianatopasella30.tearosediner.net,
Have you ever considered writing an ebook or guest authoring on other sites?
I have a blog based on the same subjects
you discuss and would really like to have you share some
stories/information. I know my audience would appreciate your work.
If you’re even remotely interested, feel free to send
me an e mail.
Also visit my page :: Leena Heaston
WOW just what I was searching for. Came here by searching
for Sandee Mensch
Also visit my web site – Lasandra Corkery (https://meet-wiki.win/index.php/20_Insightful_Quotes_About_Tech_Meozia)
Just wish to say your article is as surprising.
The clarity in your post is just great and i could assume
you are an expert on this subject. Well with your permission allow me to grab your
feed to keep updated with forthcoming post. Thanks a million and please carry on the gratifying work.
my web site Chase Demario
Hello, i feel that i noticed you visited my website thus i got here to return the desire?.I’m
trying to in finding things to enhance my site!I suppose its good enough to make use of a few of your concepts!!
My web blog – Britt Zawacki (articlescad.com)
After study a couple of of the weblog posts on your website now, and I actually like your means of blogging. I bookmarked it to my bookmark website checklist and will likely be checking back soon. Pls take a look at my website as properly and let me know what you think.
https://www.youtube.com/watch?v=_bPSWABggX8
What’s up to every single one, it’s in fact a pleasant for me to pay a
visit this site, it includes helpful Information.
Here is my website – Fitness Clothing and Supplements to help you reach your fitness goals (Jayme)
Hello There. I found your blog the use of msn. This is
a very neatly written article. I will be sure
to bookmark it and return to read extra of your useful info.
Thanks for the post. I’ll definitely return.
Feel free to surf to my blog post :: Fitness Clothing and Supplements
to help you reach your fitness goals – brooksfxndt.activosblog.com –
Hi, the whole thing is going well here and ofcourse every one is sharing information, that’s genuinely good, keep
up writing.
Here is my web page: interior design
I every time emailed this webpage post page to
all my friends, because if like to read it then my
links will too.
Here is my website custom barn doors
I adore assembling useful info, this post has got me even more info! .
http://www.vreyrolinomit.com/