Linux station VNC connection

Discussion about using NAS on Linux and Unix OS.
Post Reply
kaorw
Starting out
Posts: 12
Joined: Wed Mar 21, 2018 8:20 am

Linux station VNC connection

Post by kaorw » Mon Apr 02, 2018 2:05 pm

look like linux station use X11vnc to remote desktop option

something like https://nas.address/linux-station-vnc/

I try to access x11vnc by VNC Viewer.

It works when browser is accessing linux-station-vnc

But after I close browser, VNC stopped

Anybody knows how to prevent stop VNC?

Using Ubuntu 16.04 LTS

User avatar
OneCD
Ask me anything
Posts: 7968
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: Linux station VNC connection

Post by OneCD » Mon Apr 02, 2018 2:12 pm

If I recall correctly, the standard (default) run for x11vnc is a one-shot. Once the remote client disconnects, the server exits. There's an option to keep it active. I'll see if I can find this.

edit: Here it is - just add this to your x11vnc command:

Code: Select all

-forever

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage

kaorw
Starting out
Posts: 12
Joined: Wed Mar 21, 2018 8:20 am

Re: Linux station VNC connection

Post by kaorw » Mon Apr 02, 2018 4:58 pm

there are -forever option already in the systemd config file
/lib/systemd/system/x11vnc.service

ExecStart=/usr/bin/x11vnc -display :0 -xkb -forever -shared -rfbauth /tmp/.qnap/rfbpassword


Shuld i look for another place?

User avatar
OneCD
Ask me anything
Posts: 7968
Joined: Sun Aug 21, 2016 10:48 am
Location: "... there, behind that sofa!"

Re: Linux station VNC connection

Post by OneCD » Mon Apr 02, 2018 5:06 pm

Ah, now I'll have to ask you about this:
kaorw wrote:It works when browser is accessing linux-station-vnc

But after I close browser, VNC stopped

I'm not sure if you mean 'browser' or 'viewer'. Can you please elaborate? I've not used Linux Station as it's not available to me.

ImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImageImage

User avatar
Trexx
Ask me anything
Posts: 5298
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota

Re: Linux station VNC connection

Post by Trexx » Mon Apr 02, 2018 11:28 pm

Here is what you need to know to be able to use a non-browser based VNC client with Linux Station. I just had to do this with mine. Works just fine.
https://www.tweaking4all.com/qnap/vnc-p ... x-station/

After that all I needed was to point VNC viewer at the IP and use the updated PW I set in the process outlined in the website above.
Paul

Model: TS-877-1600 FW: 4.4.3.x
QTS (SSD): [RAID-1] 2 x 1TB WD Blue m.2's
Data (HDD): [RAID-5] 6 x 3TB HGST DeskStar
VMs (SSD): [RAID-1] 2 x 500GB Evo 860
Ext. (HDD): TR-004 [Raid-5] 4 x 4TB HGST Ultastor
RAM: Kingston HyperX Fury 64GB DDR4-2666
GPU: EVGA GTX 1060 6GB
UPS: CP AVR1350

Model:TVS-673 32GB FW: 4.4.3.x Test/Backup Box
Model:TS-228a FW: 4.4.3.x Test/Backup Box
-----------------------------------------------------------------------------------------------------------------------------------------
NAS RAID Rebuild Times | Live QTS Videos | | QNAP NAS Guide | Information needed when you ask for HELP | QNAP Links, Tutorials, etc.
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq

kaorw
Starting out
Posts: 12
Joined: Wed Mar 21, 2018 8:20 am

Re: Linux station VNC connection

Post by kaorw » Tue Apr 03, 2018 8:03 am

OneCD wrote:I'm not sure if you mean 'browser' or 'viewer'. Can you please elaborate? I've not used Linux Station as it's not available to me.


browser refers to Web browser, like chrome or safari

In linux station they give address like "nas.domain/linux-station-vnc/"

Viewers is regular VNC client like VNC Viewer

kaorw
Starting out
Posts: 12
Joined: Wed Mar 21, 2018 8:20 am

Re: Linux station VNC connection

Post by kaorw » Tue Apr 03, 2018 8:13 am

Trexx wrote:Here is what you need to know to be able to use a non-browser based VNC client with Linux Station. I just had to do this with mine. Works just fine.
https://www.tweaking4all.com/qnap/vnc-p ... x-station/

After that all I needed was to point VNC viewer at the IP and use the updated PW I set in the process outlined in the website above.


After follow every single step,

I can access via VNC Client ONLY while I open

https://nas.domain/linux-station-vnc/

..

kaorw
Starting out
Posts: 12
Joined: Wed Mar 21, 2018 8:20 am

Re: Linux station VNC connection

Post by kaorw » Tue Apr 03, 2018 8:20 am

Destroyer wrote:
kaorw wrote:there are -forever option already in the systemd config file
/lib/systemd/system/x11vnc.service

ExecStart=/usr/bin/x11vnc -display :0 -xkb -forever -shared -rfbauth /tmp/.qnap/rfbpassword


Shuld i look for another place?

your .system.d is destroyed.



Here's full text from x11vnc.service

admin@ubuntu_1604:~$ sudo cat /lib/systemd/system/x11vnc.service
[Unit]
Description=QNAP x11vnc
After=lightdm.service

[Service]
Environment="XAUTHORITY=/var/run/lightdm/root/:0" "DISPLAY=:0"
ExecStartPre=/bin/mkdir -m 0700 -p /tmp/.qnap
ExecStartPre=/bin/bash -c "[ -f /tmp/.qnap/vncpassword ] || openssl rand -base64 8 > /tmp/.qnap/vncpassword"
ExecStartPre=/bin/bash -c "x11vnc -storepasswd `cat /tmp/.qnap/vncpassword` /tmp/.qnap/rfbpassword"
ExecStartPre=/bin/chmod 400 /tmp/.qnap/vncpassword /tmp/.qnap/rfbpassword
ExecStart=/usr/bin/x11vnc -display :0 -xkb -forever -shared -rfbauth /tmp/.qnap/rfbpassword
RestartSec=10
Restart=always

[Install]
WantedBy=graphical.target

kaorw
Starting out
Posts: 12
Joined: Wed Mar 21, 2018 8:20 am

Re: Linux station VNC connection

Post by kaorw » Tue Apr 03, 2018 9:40 am

Solve the problem by create new service to systemd


[Unit]
Description=Start x11vnc at startup
After=multi-user.target

[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -shared

[Install]
WantecBy=multi-user.target

User avatar
InterClaw
Starting out
Posts: 32
Joined: Sat Apr 09, 2016 7:14 am
Location: Stockholm, Sweden

Re: Linux station VNC connection

Post by InterClaw » Sun Jul 14, 2019 7:47 am

Trexx wrote:
Mon Apr 02, 2018 11:28 pm
Here is what you need to know to be able to use a non-browser based VNC client with Linux Station. I just had to do this with mine. Works just fine.
https://www.tweaking4all.com/qnap/vnc-p ... x-station/

After that all I needed was to point VNC viewer at the IP and use the updated PW I set in the process outlined in the website above.
I was debating starting a new thread for my question, but it seems we have some knowledgeable people here so...

I've followed the guide above and it works fine. I can connect directly through VNC Viewer, without having to log into QTS first.

However, I do get a warning that the connection is not encrypted. Is there any way to enable encryption for this VNC connection?
unencrypted.jpg
For instance, if connecting to a raspberry pi using the same VNC Viewer I get no such warning, so I guess it's handled by the server and it does seem that VNC on RPi has encryption enabled. Is this available for QNAP Linux Station as well?
You do not have the required permissions to view the files attached to this post.
Model: TS-453A QTS: 4.3.6.0993 (20190704) RAID: 5
HDD: 4 x 8TB (WD80EFZX-68UW8N0 83.H0A83)
RAM: 2 x 4GB (CMSX8GX3M2B1600C9)

Post Reply

Return to “Linux & Unix (NFS)”