Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Cannot connect to QEMU VM over VNC within same network.

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
dartleader
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 138
Joined: Sun Apr 21, 2019 3:55 pm

Cannot connect to QEMU VM over VNC within same network.

  • Quote

Post by dartleader » Fri Apr 09, 2021 12:59 am

EDIT: SOLVED. Solution was to use vncviewer's -via functionality to connect across ssh.

Hello everyone,

I'm trying to host a number of virtual machines on my server at home using QEMU. When I have a test virtual machine running, it runs on the default port 5900, and I am able to see the service running from another machine within my local network, but am unable to join.

Output of scanning the remote server from my client machine:

Code: Select all

 Starting Nmap 7.91 ( https://nmap.org ) at 2021-04-08 21:42 ADT
Nmap scan report for remote-server (192.168.1.101)
Host is up (0.00036s latency).

PORT     STATE  SERVICE VERSION
5900/tcp closed vnc

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 1.64 seconds
When I try to connect to port 5900 with tigervnc's vncviewer, I get a 'connection refused' error - to nobody's surprise since the port is closed.

I have uncommented the line in /etc/libvirt/qemu.conf to allow vnc to listen to "0.0.0.0", which it states will cause it to listen to all addresses, but it has no effect.

QEMU and VNC work as expected when run on the same machine (ie: hosted on localhost), but I would like to migrate my VMs to my server and be able to connect to them remotely over wireguard.

Any help would be greatly appreciated! Thank you very much!
Last edited by dartleader on Fri Apr 09, 2021 12:26 pm, edited 1 time in total.
Top
mike155
Advocate
Advocate
Posts: 4438
Joined: Fri Sep 17, 2010 11:33 pm
Location: Frankfurt, Germany

  • Quote

Post by mike155 » Fri Apr 09, 2021 3:02 am

Is there a firewall on your server or on your client machine? Firewalls can cause 'closed' ports in the output of nmap.

Please run the commands below and post only the '5900/tcp' line of the output:
  1. On your client machine:

    Code: Select all

    nmap -d 192.168.1.101
  2. On your server:

    Code: Select all

    nmap -d 192.168.1.101
  3. On your server:

    Code: Select all

    nmap -d 127.0.0.1
Top
dartleader
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 138
Joined: Sun Apr 21, 2019 3:55 pm

  • Quote

Post by dartleader » Fri Apr 09, 2021 4:40 am

Hi Mike, output of nmap:

From client:
nmap -d 192.168.1.101 -p 5900 | rg 5900

Code: Select all

5900/tcp closed vnc     conn-refused
From server:
nmap -d 192.168.1.101 -p 5900 | rg 5900

Code: Select all

5900/tcp closed vnc     conn-refused
nmap -d 127.0.0.1 -p 5900 | rg 5900

Code: Select all

5900/tcp open vnc     syn-ack
Evidently it's open to the localhost but refuses other connections.
Top
mike155
Advocate
Advocate
Posts: 4438
Joined: Fri Sep 17, 2010 11:33 pm
Location: Frankfurt, Germany

  • Quote

Post by mike155 » Fri Apr 09, 2021 10:24 am

Thanks for the data.

What happens if you start vncviewer on your client machine with

Code: Select all

vncviewer -via <your_username>@192.168.1.101 127.0.0.1::5900
That should work :)
Top
dartleader
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 138
Joined: Sun Apr 21, 2019 3:55 pm

  • Quote

Post by dartleader » Fri Apr 09, 2021 12:25 pm

mike155 wrote:What happens if you start vncviewer on your client machine with

Code: Select all

vncviewer -via <your_username>@192.168.1.101 127.0.0.1::5900
That should work :)
Works great! Thanks for your help Mike!
Top
Post Reply

5 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic