[OpenStack noVNC]: Code 400, message Client must support ‘binary’ or ‘base64’ protocol [Solved]

Updated on December 6, 2022

As part of OpenStack Yoga release, installed and configured noVNC – a VNC client library based on JavaScript. Essentially, noVNC allows the web browser to act as a VNC client to remotely access a machine. When tried to access the virtual machine console using the console url through browser it showed blank screen as below.

OpenStack noVNC error

When looked for the errors on the server at /var/log/nova/nova-novncproxy.log found the below complete error message:

2022-11-17 18:06:39.127 2955 INFO nova.console.websocketproxy [-] - Flash security policy server
2022-11-17 18:06:39.127 2955 INFO nova.console.websocketproxy [-] - Web server (no directory listings). Web root: /usr/share/novnc
2022-11-17 18:06:39.127 2955 INFO nova.console.websocketproxy [-] - No SSL/TLS support (no cert file)
2022-11-17 18:06:39.128 2955 INFO nova.console.websocketproxy [-] - proxying from 0.0.0.0:6080 to None:None
2022-11-17 18:06:57.819 3168 INFO nova.console.websocketproxy [-] 192.168.2.15 - - [17/Nov/2022 18:06:57] code 400, message Client must support 'binary' or 'base64' protocol

Solution: After a lot of research on google, found a solution, that explains we need to edit websock.js file to support the subprotocol as below:

Open the file /usr/share/novnc/core/websock.js using your favourite editor

# vim /usr/share/novnc/core/websock.js

Locate the line

this._websocket = new WebSocket(uri, protocols);

Replace with

this._websocket = new WebSocket(uri, ['binary', 'base64']); // protocols);

Save the file and exit

Restart the openstack-nova-novncproxy service as below:

# systemctl restart openstack-nova-novncproxy

Now you can successfully access the console url on the browser.

Was this article helpful?

Related Articles

Leave a Comment