Re: xenodm + Xvfb + x11vnc = virtual display for vmm(4) OpenBSD guests

2023-07-19 Thread Morgan Aldridge
On Tue, Jul 18, 2023 at 5:42 PM Morgan Aldridge
 wrote:
>
> On On 2023-07-18, Stuart Henderson  wrote:
> > On 2023-07-18, Morgan Aldridge  wrote:
> > > I'm maintaining an OpenBSD X11 window manager (WM) port, but try to
> > > keep my primary workstation on -stable, so do most of my development
> > > there and test in Xephyr. I test & submit patches from an OpenBSD
> > > -current VM running under vmm(4), but since vmm(4) doesn't emulate
> > > video hardware, I haven't been run-testing there.
> > >
> > > I'm already comfortable with x11vnc under OpenBSD, plus Xephyr, but
> > > they both use an existing X display. After studying xenodm(1),
> > > Xvfb(1), x11vnc(1), and a bunch of other X(1)-related manual pages,
> > > plus tons of experimenting, the solution was actually quite simple.
> > >
> > > TL; DR
> > >
> > > I could find much on the Internet, list archives, etc., regarding this
> > > specific situation, so here's my solution for a [slow] X11 virtual
> > > display on a vmm(4) OpenBSD guest, accessible via VNC over an SSH
> > > tunnel:
> > >
> > >   doas rcctl enable xenodm
> > >   doas rcctl set xenodm flags \
> > > "-server ':0 local /usr/X11R6/bin/Xvfb :0 -screen 1024x768x24 -shmem'"
> > >   doas rcctl start xenodm
> > >   doas pkg_add x11vnc
> > >   doas rcctl enable x11vnc
> > >   doas rcctl start x11vnc
> > >
> > > Hope someone else finds this useful down the road,
> >
> > I recommend putting x11vnc in the bin and using tigervnc if it works for
> > your configuration...
>
> Thanks! TigerVNC's x0vncserver(1) seems to work similarly to x11vnc(1)'s
> default rc.d flags when executed as follows:
>
>   x0vncserver -SecurityTypes None -localhost
>
> This doesn't require a password (WARNING!), but does require an SSH
> tunnel to access. Is certainly snappier too!
>
> Easy enough to copy /etc/rc.d/x11vnc (before uninstalling) and update
> the 'daemon' & 'daemon_flags' values as follows:
>
>   daemon="/usr/local/bin/x0vncserver"
>   daemon_flags="-SecurityTypes None -localhost"
>
> I'm pretty sure 'rc_bg=YES' & 'rc_reload=NO' would need to be retained.

Oops, x0vncserver doesn't automatically find the appropriate
.Xauthority like x11vnc's `-auth guess` does, so while it works when
run as your user and already logged in via xenodm, it doesn't actually
work correctly from rc.d as I suggested above.

I'll investigate and do some further testing, but the nice thing about
x11vnc is that it handles the xenodm login window, plus logging in and
out as various users. Naturally, this is convenient for window manager
& desktop environment testing.

Morgan



Re: xenodm + Xvfb + x11vnc = virtual display for vmm(4) OpenBSD guests

2023-07-18 Thread Morgan Aldridge
On On 2023-07-18, Stuart Henderson  wrote:
> On 2023-07-18, Morgan Aldridge  wrote:
> > I'm maintaining an OpenBSD X11 window manager (WM) port, but try to
> > keep my primary workstation on -stable, so do most of my development
> > there and test in Xephyr. I test & submit patches from an OpenBSD
> > -current VM running under vmm(4), but since vmm(4) doesn't emulate
> > video hardware, I haven't been run-testing there.
> >
> > I'm already comfortable with x11vnc under OpenBSD, plus Xephyr, but
> > they both use an existing X display. After studying xenodm(1),
> > Xvfb(1), x11vnc(1), and a bunch of other X(1)-related manual pages,
> > plus tons of experimenting, the solution was actually quite simple.
> >
> > TL; DR
> >
> > I could find much on the Internet, list archives, etc., regarding this
> > specific situation, so here's my solution for a [slow] X11 virtual
> > display on a vmm(4) OpenBSD guest, accessible via VNC over an SSH
> > tunnel:
> >
> >   doas rcctl enable xenodm
> >   doas rcctl set xenodm flags \
> > "-server ':0 local /usr/X11R6/bin/Xvfb :0 -screen 1024x768x24 -shmem'"
> >   doas rcctl start xenodm
> >   doas pkg_add x11vnc
> >   doas rcctl enable x11vnc
> >   doas rcctl start x11vnc
> >
> > Hope someone else finds this useful down the road,
>
> I recommend putting x11vnc in the bin and using tigervnc if it works for
> your configuration...

Thanks! TigerVNC's x0vncserver(1) seems to work similarly to x11vnc(1)'s
default rc.d flags when executed as follows:

  x0vncserver -SecurityTypes None -localhost

This doesn't require a password (WARNING!), but does require an SSH
tunnel to access. Is certainly snappier too!

Easy enough to copy /etc/rc.d/x11vnc (before uninstalling) and update
the 'daemon' & 'daemon_flags' values as follows:

  daemon="/usr/local/bin/x0vncserver"
  daemon_flags="-SecurityTypes None -localhost"

I'm pretty sure 'rc_bg=YES' & 'rc_reload=NO' would need to be retained.

Morgan



Re: xenodm + Xvfb + x11vnc = virtual display for vmm(4) OpenBSD guests

2023-07-18 Thread misc



Thanks, will test. Will be useful.

On 7/18/23 20:09, Morgan Aldridge wrote:

I'm maintaining an OpenBSD X11 window manager (WM) port, but try to
keep my primary workstation on -stable, so do most of my development
there and test in Xephyr. I test & submit patches from an OpenBSD
-current VM running under vmm(4), but since vmm(4) doesn't emulate
video hardware, I haven't been run-testing there.

I'm already comfortable with x11vnc under OpenBSD, plus Xephyr, but
they both use an existing X display. After studying xenodm(1),
Xvfb(1), x11vnc(1), and a bunch of other X(1)-related manual pages,
plus tons of experimenting, the solution was actually quite simple.

TL; DR

I could find much on the Internet, list archives, etc., regarding this
specific situation, so here's my solution for a [slow] X11 virtual
display on a vmm(4) OpenBSD guest, accessible via VNC over an SSH
tunnel:

   doas rcctl enable xenodm
   doas rcctl set xenodm flags \
 "-server ':0 local /usr/X11R6/bin/Xvfb :0 -screen 1024x768x24 -shmem'"
   doas rcctl start xenodm
   doas pkg_add x11vnc
   doas rcctl enable x11vnc
   doas rcctl start x11vnc

Hope someone else finds this useful down the road,

Morgan





Re: xenodm + Xvfb + x11vnc = virtual display for vmm(4) OpenBSD guests

2023-07-18 Thread Mike Larkin
On Tue, Jul 18, 2023 at 04:09:21PM -0400, Morgan Aldridge wrote:
> I'm maintaining an OpenBSD X11 window manager (WM) port, but try to
> keep my primary workstation on -stable, so do most of my development
> there and test in Xephyr. I test & submit patches from an OpenBSD
> -current VM running under vmm(4), but since vmm(4) doesn't emulate
> video hardware, I haven't been run-testing there.
>
> I'm already comfortable with x11vnc under OpenBSD, plus Xephyr, but
> they both use an existing X display. After studying xenodm(1),
> Xvfb(1), x11vnc(1), and a bunch of other X(1)-related manual pages,
> plus tons of experimenting, the solution was actually quite simple.
>
> TL; DR
>
> I could find much on the Internet, list archives, etc., regarding this
> specific situation, so here's my solution for a [slow] X11 virtual
> display on a vmm(4) OpenBSD guest, accessible via VNC over an SSH
> tunnel:
>
>   doas rcctl enable xenodm
>   doas rcctl set xenodm flags \
> "-server ':0 local /usr/X11R6/bin/Xvfb :0 -screen 1024x768x24 -shmem'"
>   doas rcctl start xenodm
>   doas pkg_add x11vnc
>   doas rcctl enable x11vnc
>   doas rcctl start x11vnc
>
> Hope someone else finds this useful down the road,
>
> Morgan
>

Thanks. Always good to have information like this on the list for later
searchers. There are other ways too (like sthen@ replied subsequently).



Re: xenodm + Xvfb + x11vnc = virtual display for vmm(4) OpenBSD guests

2023-07-18 Thread Stuart Henderson
On 2023-07-18, Morgan Aldridge  wrote:
> I'm maintaining an OpenBSD X11 window manager (WM) port, but try to
> keep my primary workstation on -stable, so do most of my development
> there and test in Xephyr. I test & submit patches from an OpenBSD
> -current VM running under vmm(4), but since vmm(4) doesn't emulate
> video hardware, I haven't been run-testing there.
>
> I'm already comfortable with x11vnc under OpenBSD, plus Xephyr, but
> they both use an existing X display. After studying xenodm(1),
> Xvfb(1), x11vnc(1), and a bunch of other X(1)-related manual pages,
> plus tons of experimenting, the solution was actually quite simple.
>
> TL; DR
>
> I could find much on the Internet, list archives, etc., regarding this
> specific situation, so here's my solution for a [slow] X11 virtual
> display on a vmm(4) OpenBSD guest, accessible via VNC over an SSH
> tunnel:
>
>   doas rcctl enable xenodm
>   doas rcctl set xenodm flags \
> "-server ':0 local /usr/X11R6/bin/Xvfb :0 -screen 1024x768x24 -shmem'"
>   doas rcctl start xenodm
>   doas pkg_add x11vnc
>   doas rcctl enable x11vnc
>   doas rcctl start x11vnc
>
> Hope someone else finds this useful down the road,

I recommend putting x11vnc in the bin and using tigervnc if it works for
your configuration...