Skip to content

Commit

Permalink
VNC/SPICE should listen on all interfaces
Browse files Browse the repository at this point in the history
Until now, we only allowed VNC/SPICE console to listen on connections
coming from localhost. This however breaks "Desktop viewer" use case
where user wants to download a virt-viewer file to a client computer
and open a VNC/SPICE console connected to a remote VNC server.

Fixes cockpit-project#1078
  • Loading branch information
skobyda committed May 23, 2023
1 parent c905ae2 commit b7b7dc7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/scripts/install_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def get_graphics_capabilies(connection):

def prepare_graphics_params(connection):
graphics_config = {
'spice': {'listen': '127.0.0.1'},
'vnc': {'listen': '127.0.0.1'}
'spice': {'listen': '0.0.0.0'},
'vnc': {'listen': '0.0.0.0'}
}
try:
# Configparser needs a default section
Expand All @@ -57,12 +57,12 @@ def prepare_graphics_params(connection):
config = configparser.ConfigParser()
config.read_string(config_string)

graphics_config['spice']['listen'] = config['dummy_section'].get('spice_listen', '127.0.0.1')
graphics_config['spice']['listen'] = config['dummy_section'].get('spice_listen', '0.0.0.0')
spice_password = config['dummy_section'].get('spice_password', None)
if spice_password is not None:
graphics_config['spice']['password'] = spice_password

graphics_config['vnc']['listen'] = config['dummy_section'].get('vnc_listen', '127.0.0.1')
graphics_config['vnc']['listen'] = config['dummy_section'].get('vnc_listen', '0.0.0.0')
vnc_password = config['dummy_section'].get('vnc_password', None)
if vnc_password is not None:
graphics_config['vnc']['password'] = vnc_password
Expand Down

0 comments on commit b7b7dc7

Please sign in to comment.