How-To: Remote Control Your Phone from Desktop via VNC
#1
<This is currently partly broken on my Mobian trixie Pinephone pro the VNC viewer shows a grey screen but input is usable>
Do you wish there was an easy hands-free way to interact with your PP's touch GUI  while sitting in front of your desktop system?
Would you like to compose, read, and send SMSs and IMs using your full size keyboard? Interact with your mobile apps using your desktop's mouse, and screen?
Is there a way to cut and paste between your phone and Desktop?
Maybe you would like to initiate and end hands-free or speakerphone calls without touching your phone?

These and more are all possible using VNC to remotely interact with the GUI of your Pinephone.

Let's start with your Pinephone; mine is running Mobian but the instructions should work for other distros; use your system's package installer. (this is for systems running Weyland for video, x11(and mir/surfaceflinger) uses a different VNC server)
Code:
sudo apt install wayvnc
once wayvnc is installed the way I run it is with a launch script I keep in my home directory, I named my script V (the 0.0.0.0 allows incoming connections from outside localhost)
Code:
#! /bin/bash
wayvnc 0.0.0.0
make our script V executable
Code:
chmod +x  V
launch manually on the pinephone's shell console like this
Code:
./V
The VNC server on your phone is now waiting for a client to connect, as configured is not secured and is unencrypted.

This setup when run on your Weyland video server Pinephone will let your login when the VNC server is running on your PP without any security or password config on either side.  The VNC server script above is launched and killed manually so it is not running all of the time in this config, you save precious battery when mobile.  If you wanted you could make a desktop entry to give you a GUI launcher for the sell script, just kill that shell window to kill the server.

Now install the VNC viewer GUI  on your desktop Linux machine(other OSs also have VNC client software)
Code:
sudo apt instal tigervnc-viewer
Now in this insecure home LAN setup just run ./V on your Pinephone, then set the phone's LAN IP address in the tigervnc-viewer GUI running on your desktop system and click connect; a window with your PP's interactive GUI will appear on your desktop machine.

In options I recommend reviewing the cut/paste options in tigervnc-viewer Input tab,  clicking the 'show dot when no cursor' in the also in Input tab so you have a way to see your mouse in some server configs, as well as ensuring that in the Security tab the encryption and authentication options including none as in my example are to your preference.

This is all you need to remote control your phone via desktop; it is a near perfect way to interact with your Weyland Pinephone.  This setup  also works if you are using the PP as your wifi(or USB cable or Bluetooth) tether hotspot just be sure to update the PP's IP address.  This quick tryout setup is only viable in a situation where the phone and laptop are on a private WLAN with no possibility of other users, any other situation where the VNC server is running gives all users who can scan the network for open VNC port free GUI access to your PP with no barriers.  It is easy to set a user name and password as well as encryption for the connection, a secure setup requires editing a .conf file on your PP  with username and password as well as generating an RSA key.  see https://github.com/any1/wayvnc

If you have trouble with cut/paste showing boxes rather than text it is a font matching problem and I have solved this by using the on-phone web browser for some non-English languages rather than my desktop's; there are better ways to solve the problem though.
VIew the wayvnc git for secure setup and running instructions https://github.com/any1/wayvnc

I find that if I am doing heavy interaction with my PP while in my office VNC, an SSH session, as well as Filezilla to move files around makes everything so easy I rarely need to touch my charging PP except to wake it up if it goes into standby mode and disconnects from the WLAN.
  Reply
#2
Yes, wayvnc works quite well, I've been using it for a few years now. What I do though is have it listening only to localhost (127.0.0.1) connections. Then port 5900 is tunneled through an ssh session to use it. (The ssh server runs automatically at boot time and permits key-based login only, password logins are disabled.)
  Reply
#3
(10-11-2024, 09:36 AM)Zebulon Walton Wrote: Yes, wayvnc works quite well, I've been using it for a few years now. What I do though is have it listening only to localhost (127.0.0.1) connections. Then port 5900 is tunneled through an ssh session to use it. (The ssh server runs automatically at boot time and permits key-based login only, password logins are disabled.)

A great way to get bulletproof security, and easier if only used occasionally.  SSH is probably one of the most hardened services.
  Reply
#4
SO I just did a reinstall back to Trixie...
I connect and I can see the mouse on the PPp and can control the PPp as setup above; but the window in tigervnc-viewer is all grey.
(edit)
So from a bit of search it seems to be a Gnome related bug, not sure where to go from there since I cant really easily change the GUI like that.
I guess for now I have to use the PPp's screen to see what I am doing with my mouse and KB but at least I can still cut/paste between the two systems.
Hopefully an update will fix VNC.
  Reply
#5
Quote:this is for systems running Weyland for video

More specifically, this requires a wlroots-based compositor. So it should work on, e.g., SXMO Wayland edition (formerly known as SWMO) or Phosh, but not on, e.g., Plasma Mobile or GNOME Shell. (For Plasma Mobile, one will probably want to use Krfb, though that's a GUI and not particularly mobile-friendly. But it is what works with kwin_wayland. For GNOME Shell, one will probably want to use the corresponding GNOME tool.)
  Reply
#6
(03-03-2025, 06:51 AM)Kevin Kofler Wrote:
Quote:this is for systems running Weyland for video

More specifically, this requires a wlroots-based compositor. So it should work on, e.g., SXMO Wayland edition (formerly known as SWMO) or Phosh, but not on, e.g., Plasma Mobile or GNOME Shell. (For Plasma Mobile, one will probably want to use Krfb, though that's a GUI and not particularly mobile-friendly. But it is what works with kwin_wayland. For GNOME Shell, one will probably want to use the corresponding GNOME tool.)

Hmmm, I am using Phosh....
I didn't find enough information so far to begin to troubleshoot it, and since I use VNC to the PPp so much I need to find some time to do that.
  Reply
#7
The Phosh Wayland compositor (phoc) uses wlroots, which is why it works with wayvnc.
  Reply
#8
(03-04-2025, 10:19 AM)biketool Wrote:
(03-03-2025, 06:51 AM)Kevin Kofler Wrote:
Quote:this is for systems running Weyland for video

More specifically, this requires a wlroots-based compositor. So it should work on, e.g., SXMO Wayland edition (formerly known as SWMO) or Phosh, but not on, e.g., Plasma Mobile or GNOME Shell. (For Plasma Mobile, one will probably want to use Krfb, though that's a GUI and not particularly mobile-friendly. But it is what works with kwin_wayland. For GNOME Shell, one will probably want to use the corresponding GNOME tool.)

Hmmm, I am using Phosh....
I didn't find enough information so far to begin to troubleshoot it, and since I use VNC to the PPp so much I need to find some time to do that.

hi everyone, thanks for all the great comments. recently got my ppp/mobian to be useful, lots of patience needed but worthwhile. All software is up-to-date.
Cannot get  wayvnc server to output anything else except a gray screen on any (of a number of) vnc viewers on remote desktops. As described above, mouse moves and controls ppp's GUI but screen is just gray. Tried -DRv and combinations thereof on wayvnc command. No error messages appear. Tried also resetting color depth on viewers (presumably ppp is 24-bit). Anyone got this to work yet? Config files for wayvnc perhaps? I have not tried yet with headless output but I don't see why that would make a difference.
  Reply
#9
(03-05-2025, 06:18 AM)Kevin Kofler Wrote: The Phosh Wayland compositor (phoc) uses wlroots, which is why it works with wayvnc.

SO I have something based on stripped ubuntu 24.04 and echo $XDG_SESSION_TYPE says x11 for my computer and I use tigerVNC viewer.  I used to get video from the PPp running Mobian trixie and now I get the grey on theVNC but I can use it for input if I can see the phone's screen.
I am not sure if wlroots requires a change in the config of the VNC server on the PPp?
  Reply
#10
(10-10-2025, 06:25 AM)biketool Wrote:
(03-05-2025, 06:18 AM)Kevin Kofler Wrote: The Phosh Wayland compositor (phoc) uses wlroots, which is why it works with wayvnc.

SO I have something based on stripped ubuntu 24.04 and echo $XDG_SESSION_TYPE says x11 for my computer and I use tigerVNC viewer.  I used to get video from the PPp running Mobian trixie and now I get the grey on theVNC but I can use it for input if I can see the phone's screen.
I am not sure if wlroots requires a change in the config of the VNC server on the PPp?

hi, no solution but just remarks: looking up the problem there are lots of reasons why wayvnc may show a gray screen. one of the principal ones is that mobian's user (usually 'mobian') is not in the 'video' users group by default. unfortunately, "sudo usermod mobian -aG video" neither fixes the vnc problem, nor the other great problem of mobian that keeps it short of daily driving (for some people): the camera. No matter which camera app is used - related because the video group addition was suggested as a fix for both of these problems.

must be something in the setting of wlroots or wayvnc - strange that no error or warning appears at all, just gray screen (and apparently works in other distros that use phosh).
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Jami on the Pine phone ? bcnaz 8 11,546 06-09-2025, 04:17 PM
Last Post: j_s
  is there an progam to forward calls and texts to my desktop dallytaur 2 4,375 11-01-2023, 04:55 AM
Last Post: Samurai_Crow
  Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly lupyuen 64 44,443 09-09-2023, 09:49 AM
Last Post: WhiteHexagon
  Article: NuttX RTOS for PinePhone: Phone Calls and Text Messages lupyuen 2 3,162 05-03-2023, 05:03 PM
Last Post: lupyuen
  [Stupid Question] Where is the phone camera software?! newusername 5 5,657 10-10-2022, 03:58 AM
Last Post: newusername
  Control HBIAS through a linux OS twiclo 0 1,738 10-04-2022, 03:20 PM
Last Post: twiclo
Question New user/phone here - initial update issues sexywheat 2 3,277 06-29-2022, 04:27 PM
Last Post: sexywheat
  Which apps can I run on this phone? poppyhodler 2 4,209 06-07-2022, 12:18 PM
Last Post: jenniferjohn12
  Phone Operation which SW Realease (mute funtion)? scrwbigtek 0 1,593 05-25-2022, 07:35 AM
Last Post: scrwbigtek
  First time pine phone user Matt73 3 4,510 03-10-2022, 02:04 AM
Last Post: Matt73

Forum Jump:


Users browsing this thread: 1 Guest(s)