Re: X11 Forwarding from FreeBSD Qemu Guest to Linux Host

From: Jishan Alam <jishanalam9128_at_gmail.com>
Date: Fri, 23 Jan 2026 16:09:36 UTC
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

On Fri, Jan 23, 2026 at 9:22 PM Paul Procacci <pprocacci@gmail.com> wrote:
>
> On Fri, Jan 23, 2026 at 10:50 AM Jishan Alam <jishanalam9128@gmail.com> wrote:
> >
> > 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
> >
>
> You need to supply the config file for sshd.  You're problem most
> likely lies there.
>
> ~Paul
>
> --
> __________________
>
> :(){ :|:& };:



-- 
Best Regards,
Jishan Alam