Movies are see-through in VNC

My Xfce Manjaro runs a TigerVNC server.

Problem: When I start a VNC session and play a movie, e.g. an mp4 in SMPlayer or VLC, I can see through the video at the desktop (whether that is a picture or solid color), and consequently the movie gets a faded-out look.

If the same movie is played in Firefox, the video is normal.

When I used to use Gnome Ubuntu, the video was normal in SMPlayer and VLC (as well as Firefox).

My Xfce Manjaro uses ~/.vnc/config for config and with these simple contents:

session=xfce
depth=32
alwaysshared
geometry=1300x900

My Gnome Ubuntu used ~/.vnc/xstartup and with these contents (not one bit of which I understood):

#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &
dbus-launch --exit-with-session gnome-session &

Questions

  1. What can I do to my Xfce Manjaro so video plays normal in any app?
  2. If that’s not possible, should I install Gnome to it and try to replicate what I had with Gnome Ubuntu?
  3. Or if that’s not advisable, am I reduced to having to build a Gnome Ubuntu? (These are all virtual machines, and there is no cost except in the form of my time.)

On my use case: I don’t regularly watch movies via VNC. I have some messengers that I don’t want to be looking at constantly, and so they are banished into a virtual machine in a computer in another room. I go in it once in a while and find that somebody has sent me a movie clip. I don’t want to have to download the thing and SMB into the same VM to watch the clip. I just want it to play in VNC. It’ll be something short and probably stupid.

I kind of solved this one. This is what I did.

  1. Rename ~\.vnc\config to ~\.vnc\config.bak

This was just putting it out of the way.

  1. Create ~/.vnc/xstartup

  2. Put the following contents in it and save.

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
/usr/bin/startxfce4
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
x-window-manager &

  1. Run: chmod +x ~/.vnc/xstartup

Steps 3 and 4 come from this page: How to Install VNC Server Ubuntu 22.04

And it worked! The overall VNC experience is exactly the same as before except that movies play normal in all apps and, of course, I lost my geometry from config.

Sometimes faith works.

Now if I could only work that geometry back into xstartup or elsewhere.

ADDING LATER

Movies play normal in VLC. In SMPlayer, at least video is not see-through but may stop in a few seconds (this happened in only one VNC session among many, was maybe just a fluke).

Also, xstartup can have just these contents, as modified from that provided by linux-aarhus (see below):

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
/usr/bin/startxfce4 &

In sum, the solution is to move the choice of xfce from config to xstartup.

Why the computer would ever think I’d want washed-out looking video is beyond me. (“Oh, you want normal looking video? Why didn’t you say so in xstartup? Only those who like washed-out video use config.”)

On specifying geometry, see this other post for what it’s worth: Geometry (screen resolution) option for TigerVNC

I think you should bring that config file back, at least according to the wiki:

Create ~/.vnc/config and at a minimum, define the type of session desired with a line like session=foo where foo corresponds to whichever desktop environment is to run.

https://wiki.archlinux.org/title/TigerVNC

Thanks for pointing that out.

I did restore config.

The result was that nothing changed from when it was named config.bak.

For example, the geometry setting in config remains effectless. I believe xstartup may have superceded it.

ADDING LATER

I am amending this reply for the poor soul who will have the same problem and try my remedy.

DO NOT restore config. That will bring back the see-through video. Just live with xstartup.

Linux shell scripting is a very powerful tool which I had a hard time learning and I am still a padawan.

The script you found uses conditions to decide if a certain part should be executed.

The first two commands unset named environment variables.

The third starts an xfce4 session - but because you have not added the continuation marker - the script will stop execution until the xfce4 session ends - then it will continue with the remaining commands

exec is a keyword which turns over control to the command - which in turn will stop execution of the script.

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup

The above line verifies it the file exist and if it does - the shell turns over control to xstartup script

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

This line will execute xrdb if the file .Xresources is found in the user’s home.

To learn what xrdb is capable of use the xrdb(1) — Arch manual pages

man xrdb

As you will see - you can add your preferred width and height to the xrdb command - like this

[ -r $HOME/.Xresources ] && xrdb -height=900 -width=1300 $HOME/.Xresources

Then it executes the command x-window-manager and releases the script.

x-window-manager is an unknown command - at least on my system …

Ohhh, so THAT’S why there is a trailing & for it, to not “stop”? I was reading the script and understood that it first checked if the file was executable, but then I could not figure out why the script executed itself. It then checks that .Xresources is readable and if so runs xrdb… That is pretty darn clever.

Pretty sure that is a debian thing since he got the script from a debian based instruction page.

I was curios about that too - and it turns out the script is a symlink to /etc/alternatives/x-window-manager which in turn is a symlink to /usr/bin/gnome-session script which in turn launches the gnome-session-binary with the supplied arguments - that is at least the case with Ubuntu 18.04.

The final destination script
#!/bin/sh

if [ "x$XDG_SESSION_TYPE" = "xwayland" ] &&
   [ "x$XDG_SESSION_CLASS" != "xgreeter" ] &&
   [  -n "$SHELL" ] &&
   grep -q "$SHELL" /etc/shells &&
   ! (echo "$SHELL" | grep -q "false") &&
   ! (echo "$SHELL" | grep -q "nologin"); then
  if [ "$1" != '-l' ]; then
    exec bash -c "exec -l '$SHELL' -c '$0 -l $*'"
  else
    shift
  fi
fi

#SETTING=$(gsettings get org.gnome.system.locale region)
#REGION=${SETTING#\'}
#REGION=${REGION%\'}

if [ -n "$REGION" ]; then
  export LC_TIME=$REGION
  export LC_NUMERIC=$REGION
  export LC_MONETARY=$REGION
  export LC_MEASUREMENT=$REGION
  export LC_PAPER=$REGION
fi

exec /usr/lib/gnome-session/gnome-session-binary "$@"

@jamjar I guess we have found another place where you can define the LC_COLLATE we figured out in your other thread. xD

Edit
For clarification, I AM JOKING (but also not, because it probably WOULD work to set it here), do not do that, the LC_COLLATE we set in /etc/locale.conf should stay there…

The place I found it was Ubuntu 18.04 - I highly doubt the same files are present - but it should be doable to create similar functionality.

Shhhh, don’t burst my bubble, let me think I’m the funniest person alive, for just a few minutes please. :joy:

I do not have the technical expertise to get it, but I am certain that it was a VERY funny joke.

Can either of you tell me, then, what my xstartup should look like if it was to

  • do the work it does for me (of making vidoes play normal in all apps) and
  • not have extraneous materials (such as the symlink to nothing)?

IMHO, if it works, why look for problems that doesn’t really exist.

I would try to follow the arch wiki and see if I could get another way working that is done for ARCH and not debian.
Use xfce if you got that working, otherwise try to use the desktop environment you actually installed to begin with (if it wasnt xfce).
You find, as described in the wiki, what environments you have available by running ls /usr/share/xsessions/. For me it produces plasma.desktop witch means I set it to run in plasma.
Play around with it, don’t be afraid, just make sure you make backups of the files you change so you can revert.

But again, if it works, and you are not a masochistic person like me wanting to understand and control EVERYTHING ignoring all the headaches that brings, why mess with it?

Yes, I am happy enough for now. But it would be nice if somebody could tell me which line in xstartup is giving me normal video or even why I didn’t have it in the first place.

  1. Because it is the way to make things work better. The first computer also worked…
  2. Curiosity factor. Playing around is fun! And the satisfaction when getting it right…that’s some real sh1t right there.

So, @jamjar, just make sure you’ve got backups and continue playing!

That’s a ‘defenition’.
If it breaks trying to change things, taking hours, maybe days to figure out, just to get it to work ‘better’, is that really ‘better’.

I absolutely see your point and I’m EXACTLY the same, but we have to establish what kind of person you are before knowing if that would render satisfaction rather than frustration on the WAY to a NEW solution.

Same argument goes here. But again, yes, for MY personality this fits. I’m also stubborn AF… :smiley:

But we are getting really off topic here.

Yes. This isn’t a psychology forum…

You sure? I USE ARCH BTW!

Sorry, I just had to, I’m in a very good mood today. :hearts:

Relatively…

Well, that says something about the awesomeness of the Manjaro community…

In case you have not seen replies after your own last, could you tell me which line in my Debian-born xstartup is doing the actual work (giving me normal video) and which lines I could therefore delete as extraneous? In short, what should a version of xstartup look like that has shed unneeded elements? Thanks.

I assume the line containing /usr/bin/startxfce4 is your doing

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
/usr/bin/startxfce4
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
x-window-manager &
  • Commented lines
  • Using xfce session as replacement for the x-window-manager script.
  • Added a copy of previous xrdb line to set screensize at 1300x900
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
#/usr/bin/startxfce4
#[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
#[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
[ -r $HOME/.Xresources ] && xrdb -width=1300 -height=900 $HOME/.Xresources
#x-window-manager &
/usr/bin/startxfce4 &

No guarantees what-so-ever as the problem you are trying to solve is beyond my grasp.

The added line on setting the size has been made as OT stated I lost my geometry