X11 Forwarding from FreeBSD Qemu Guest to Linux Host

0 views
Skip to first unread message

Jishan Alam

unread,
Jan 23, 2026, 10:50:20 AM (8 days ago) Jan 23
to freebsd-...@freebsd.org
Hello,
So I have set up FreeBSD-15.0 in my system using qemu and I'm using
ssh to connect to the local qemu instance using ssh.

Host System: Arch Linux 6.18.2 Hyprland (Xwayland installed)
Guest System: FreeBSD 15.0 (Qemu) (xorg-apps, xauth and xterm installed)

So what I would like to try is to run GUI applications without
installing the whole Desktop Environment in FreeBSD and I'm trying to
achieve this using the X11 Forwarding option from ssh with
X11Forwarding options enabled but It's still not connecting. Is it due
to using hyprland in my host?
I'm trying the following:

1. Start Qemu using the following command
qemu-system-x86_64 \
-m 4096 \
-smp 4 \
-enable-kvm \
-drive file=freebsd15.qcow2,format=qcow2 \
-boot d \
-net nic \
-net user,hostfwd=tcp::2222-:22

2. Normally Connect using the following command
ssh user@localhost -p 2222

3. Now Im trying to connect using the following command
ssh -X user@localhost -p 2222
and
ssh -Y user@localhost -p 2222

4. after connection I try the following command
echo $DISPLAY
which displays nothing and I supposed its supposed to display
something like `localhost:10.0` but its not

5. Tried with verbose output
ssh -vv -X user@localhost -p 2222
the relevent logs
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: x11_get_proto: /usr/bin/xauth list :1 2>/dev/null
Warning: No xauth data; using fake authentication data for X11 forwarding.
debug1: Requesting X11 forwarding with authentication spoofing.
debug2: channel 0: request x11-req confirm 1
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug2: channel 0: request shell confirm 1
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug1: Remote: No xauth program; cannot forward X11.
debug2: channel_input_status_confirm: type 100 id 0
X11 forwarding request failed on channel 0
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0

as you can see its says `X11 forwarding request failed on channel 0`
So I don't know what to do next or how to debug this
Any tips would be appreciated

--
Best Regards,
Jishan Alam

Paul Procacci

unread,
Jan 23, 2026, 10:53:09 AM (8 days ago) Jan 23
to Jishan Alam, freebsd-...@freebsd.org
You need to supply the config file for sshd. You're problem most
likely lies there.

~Paul

--
__________________

:(){ :|:& };:

Jishan Alam

unread,
Jan 23, 2026, 11:10:22 AM (8 days ago) Jan 23
to Paul Procacci, freebsd-...@freebsd.org
The only options that i have enabled from are X11Forwarding and X11UseLocalhost

the /etc/ssh/sshd_config

# $OpenBSD: sshd_config,v 1.105 2024/12/03 14:12:47 dtucker Exp $

# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.

# Note that some of FreeBSD's defaults differ from OpenBSD's, and
# FreeBSD has a few additional options.

#Port 22
#AddressFamily any
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

#PubkeyAuthentication yes

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile .ssh/authorized_keys

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# Change to "yes" to enable built-in password authentication.
# Note that passwords may also be accepted via KbdInteractiveAuthentication.
#PasswordAuthentication no
#PermitEmptyPasswords no

# Change to "no" to disable keyboard-interactive authentication. Depending on
# the system's configuration, this may involve passwords, challenge-response,
# one-time passwords or some combination of these and other methods.
# Keyboard interactive authentication is also used for PAM authentication.
#KbdInteractiveAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

# Set this to 'no' to disable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the KbdInteractiveAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via KbdInteractiveAuthentication may bypass
# the setting of "PermitRootLogin prohibit-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and KbdInteractiveAuthentication to 'no'.
#UsePAM yes

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
X11UseLocalhost yes
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#UseBlocklist no
#VersionAddendum FreeBSD-20250801

# no default banner path
#Banner none

# override default of no subsystems
Subsystem sftp /usr/libexec/sftp-server

# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server

fatty.merc...@aceecat.org

unread,
Jan 23, 2026, 12:29:10 PM (8 days ago) Jan 23
to ques...@freebsd.org, freebsd-...@freebsd.org
On Fri, Jan 23, 2026 at 09:19:40PM +0530, Jishan Alam wrote:

> 5. Tried with verbose output
> ssh -vv -X user@localhost -p 2222

This reads quite clear to me:

> debug1: Remote: No xauth program; cannot forward X11.

You need to install the package or port that contains xauth in the
guest system. On my Ubuntu desktop, it's in its own package "xauth".

--
Ian

Jishan Alam

unread,
Jan 23, 2026, 1:42:37 PM (7 days ago) Jan 23
to ques...@freebsd.org, freebsd-...@freebsd.org
as I have mentioned xauth is already installed but it installs in
/usr/local/bin/xauth and ssh expects it to be in /usr/bin/xuath

debug2: channel_input_open_confirmation: channel 0: callback start
debug2: x11_get_proto: /usr/bin/xauth list :1 2>/dev/null
Warning: No xauth data; using fake authentication data for X11 forwarding

acc to this so i moved created soft link to xauth in /usr/bin even
then nothing happens same error log

Jackie J

unread,
Jan 27, 2026, 5:54:57 PM (3 days ago) Jan 27
to ques...@freebsd.org, freebsd-...@freebsd.org
Did you try getting the DISPLAY from the VM guest in a graphical session
and exporting it in your ssh session? I remember in cases where I had to
manually export it in a remote X11 session.

Best,
Jun


Jishan Alam <jishana...@gmail.com> 于 2026年1月23日星期五 GMT-6 12:42:30写道:

Jishan Alam

unread,
Jan 27, 2026, 11:18:50 PM (3 days ago) Jan 27
to Jackie J, ques...@freebsd.org, freebsd-...@freebsd.org
I have tried setting the DISPLAY in the ssh session it's giving
xterm: Xt error: Can't open display: :1
as usual.
My DISPLAY in my host is also ::1 and i also tried ::0 both doesnt work

Jishan Alam

unread,
Jan 28, 2026, 10:36:39 PM (2 days ago) Jan 28
to Jackie J, freebsd-...@freebsd.org, ques...@freebsd.org
Do you have X11 or wayland running in your current distro? I think the
problem is with my Hyprland Instance and Xwayland doesnt seem to work
with ssh x11 forwarding.
Reply all
Reply to author
Forward
0 new messages