Skip to content

webvirtmgr vnc change listen to 127.0.0.1

Aysad Kozanoglu edited this page Jul 13, 2019 · 4 revisions

Machines created by webvirtcloud and webvirtmgr is setting vnc listen on 0.0.0.0, I think it's not safe.

I have modified /var/www/webvirtmgr/vrtManager/create.py from

<graphics type='%s' port='-1' autoport='yes' listen='0.0.0.0'>
    <listen type='address' address='0.0.0.0'/>
</graphics>

to

<graphics type='%s' port='-1' autoport='yes'/>

But it seems noVnc is not working with vnc listen on 127.0.0.1, I'm using socket connection, so I modified /var/www/webvirtmgr/console/webvirtmgr-console

elif console_socket or re.match('^127\.', console_host):

to

elif console_socket or re.match('^127\.', console_host) and conntype != CONN_SOCKET:

and everything works fine