bhyve How to get x11forwarding from vm to host?

I also want xauth, but file /root/.Xauthority does not exist
As far as I know, with xdm security mechanisms are activated. Perhaps you can try and see.

I do it with xinit, I have files .xinitrc and .xserverrc where I start Xorg with tcp flag, far of the ideal.
I do not know how to do it with xdm.

No, this is a direct connection to X, nothing to do with X forwarding.
Yes, a lapsus.
 
I don't understand what the OP's issue with X-forwarding is though, I've done this a million times and it typically works without any issues. The only thing that bit me at some point was the fact X-Forwarding defaulted to "off" instead of "on" with sshd(8).
 
Perhaps the problem is not in xauth, just tried with -Y:
# env DISPLAY=localhost:0.0 ssh -XY hruodr@remoteserver /usr/X11R6/bin/xclock
Enter passphrase for key '/usr/home/hruodr/.ssh/id_rsa':
Warning: No xauth data; using fake authentication data for X11 forwarding.
X11 forwarding request failed on channel 0
Error: Can't open display:
 
I feel like I'm missing something here. My notes don't indicate any use of SSH at all to access my VM's Xorg display. The only thing that I've done to get it working was use the UEFI loader and I was able to access the VM via tigervnc using the port listed in the vm's .conf.

loader="uefi"
graphics="yes"
graphics_port="5999"
graphics_listen="0.0.0.0"
graphics_res="1920x970"
graphics_wait="auto"

Is there some reason why SSH needs to be involved in this? And if it's for remote access from a different computer, wouldn't it be easier to just forward whatever port the conf lists?
 
I can access guest with ssh.
ssh -Y root@1.1.1.1
But when I logined in,
/usr/local/bin/xauth file /root/.Xauthority does not exist
[/QUOTE]
Make sure that x11/xauth is installed on the guest machine. It's trying to add an MIT-MAGIC-COOKIE to the .Xauthority file on the VM.
[QUOTE="Annalesa, post: 744575, member: 84253"]

/usr/local/bin/xauth (stdin):1: bad display name "unix:10.0" in "remove" command
/usr/local/bin/xauth (stdin):2: bad display name "unix:10.0" in "add" command

and when I run
xclock,
it is
X11 connection rejected because of wrong authentication
Error: cant open display: localhost 10.0

I have
PermitRootLogin yes
X11Forwarding yes
X11DisplayOffset 10

in the /etc/ssh/sshd_config of guest.
I have not installed the vm-bhyve so I don't have the "vm list" command
It won't work without xauth installed.
 
And forwarding the port that it's exporting doesn't accomplish that?
Entirely different way. What you have is a graphics console you can access through VNC.

With remote X you connect from system A to system B, run the application on B and get the actual window/widgets/whatnot of that application on system A. The upshot of this is that you do not need to have a "full" or "complete" X environment on B.
 
Had to wait until I got home, had dinner. Set up the test machine, looked for a way to make a screenshot. Then:
xforward.png
(sorry for the resolution, I know, it's a lot)

I mean I can't tell you why it's not working for you. All I can say, the only applications installed on fbsd-test are x11/xclock and x11/xauth. I set X11Forwarding yes in sshd_config(5), restarted sshd(8). Deleted the existing ~/.Xauthorized that got created with a test connection. That's it. No messing with DISPLAY.

Heck, this even works from a Windows desktop with X-Forwarding turned on with PuTTY and XcXsrv. Or MobaXTerm using its Xserver.
 
With remote X you connect from system A to system B, run the application on B and get the actual window/widgets/whatnot of that application on system A. The upshot of this is that you do not need to have a "full" or "complete" X environment on B.
Tragic that it is necessary to explain this.

People do not understand anymore what X11 really is.

That is why they think wayland is a substitute X11.

That is why X11 is in danger.


I set X11Forwarding yes in sshd_config(5),
That is perhaps the problem. I am using a remote OpenBSD system in which I am not root.
The one in which I am root, runs debian, and I am afraid that installing xclock, it will install the whole server.
Also that is part of the not understanding of X11: that clients and server do not need to be in the same computer.
 
I think cy may be right, you need to 'pkg install xauth', on both the host and the VM. I seem to remember I had to manually install xauth recently, it wasn't installed automatically as a dependency of xorg; ssh uses xauth in the security negotiation between the x server on the host and the proxy socket on the client to set up the X11 protocol tunnel to the server over ssh. Does /usr/local/bin/xauth exist on both the host and the VM machines? If not, 'pkg install xauth' on whichever is it missing from and try it again.
 
Back
Top