[OOD-users] Fixing NoVNC screen resolution

Jeremy Nicklas jeremywnicklas at gmail.com
Tue Oct 30 23:28:50 EDT 2018


Hi Eric,

I do not remember experiencing similar issues with Matlab at OSC back when
I experimented with it (although it has been awhile). But I do know Matlab
bundled its own software rendering opengl drivers which caused us quite a
few headaches until we avoided loading them. So be mindful of all the
libraries that Matlab bundles and loads.

Currently the input field for `bc_vnc_resolution` is force hidden in the
code here:

https://github.com/OSC/ood-dashboard/blob/25c54a55d6a84905c7b324eb39d05e0c374bf5de/app/models/batch_connect/app.rb#L151-L152

I am the one who added that code 2 years ago, but I can't remember the
reasoning behind it anymore (possibly there were some issues with noVNC at
the time).

Good news is that just about everything can be overridden. So one
suggestion is to create a new form attribute, let's call it `vnc_resolution`
and define it as such in your `form.yml`:

---
title: "ACCRE Fixed-Screen Desktop"
cluster: "accre"
attributes:
  ...
  vnc_resolution:
     required: true
     widget: "resolution_field"
     label: "Desktop Screen Resolution (px)"
     value: "1024x768"
form:
   ...
   - vnc_resolution
   - bc_email_on_started
submit: "submit/my_submit.yml.erb"

Note, be sure to remove `bc_vnc_resolution` from your `form.yml` if you do
this or you may have a conflict.

Then (I believe as I can't really test it) in your `submit/my_submit.yml.erb`
you will have something like:

---
batch_connect:
  template: vnc
  geometry: vnc_resolution.blank? ? "1024x768" : vnc_resolution.strip
script:
  ...

Last but not least we need to fix the links to noVNC so that it doesn't try
to auto-resize when the browser window changes size. You can override the
panel view the user sees to connect to the session by including a `
view.html.erb` file in your interactive app's root directory (similar to
what we do for the Jupyter app). So an example would be:

<a
href="/pun/sys/dashboard/path/to/noVNC-1.0.0/vnc.html?autoconnect=true&password=<%=
password %>&path=rnode/<%= host %>/<%= websocket %>/websockify&resize=off"
class="btn btn-primary" target="_blank">
  <i class="fas fa-eye"></i> Launch noVNC in New Tab
</a>
<a
href="/pun/sys/dashboard/path/to/noVNC-1.0.0/vnc.html?autoconnect=true&password=<%=
spassword %>&path=rnode/<%= host %>/<%= websocket %>/websockify&resize=off"
class="btn btn-primary pull-right" target="_blank">
  View Only (Share-able Link)
</a>

Note, I took a guess at the path for the noVNC installation links (notice
that I stubbed it with "/.../path/to/..."). You should copy the links from
the respective buttons in your Dashboard for a running session in your
browser. After swapping in the ERB code for the connection variables you
will set "resize=off" at the end of the URL to achieve what you want.

I did most of this off the top of my head, so anyone else is free to
correct my mistakes. Hope this helps.

-Jeremy Nicklas

On Tue, Oct 30, 2018 at 2:44 PM Eric Appelt via OOD-users <
ood-users at lists.osc.edu> wrote:

> Hi Everyone,
>
> We are getting close to finishing our evaluation phase of OOD with
> select labs and deployment of the service at Vanderbilt's ACCRE facility
> for general use.
>
> One of our clients uses MATLAB and has noticed two issues related to
> automatic screen sizing through NoVNC. This causes issues when the user
> closes NoVNC on their desktop and opens it again on their laptop. The
> remote desktop screen is resized causing MATLAB to panic and throw a
> cascade of java exceptions.
>
> Another related issue is that when a session is initialized on the
> smaller laptop screen, the remote desktop size is too small for some of
> their MATLAB applications and the font is unreadable. What they need is
> a remote screen larger than the actual browser window that they can
> "Clip to Window" in NoVNC and pan around.
>
> For both these problems I was hoping I could create an interactive
> desktop form where the user could specify a desired screen size in
> pixels using "bc_vnc_resolution". However, I can't seem to get the form
> attribute to show up, nor does XFCE seem to respect this setting as
> NoVNC will default to remote resizing and rescale a window. My yml form
> is as follows:
>
> ---
> title: "ACCRE Fixed-Screen Desktop"
> cluster: "accre"
> attributes:
>    desktop: "xfce"
>    bc_account: null
>    bc_queue: null
>    bc_num_slots: null
>    bc_mem:
>      label: "Maximum Memory (GB)"
>      value: 4
>    bc_num_cores:
>      label: "Number of CPU Cores"
>      value: 1
>    bc_vnc_resolution:
>      required: true
>      widget: "resolution_field"
>      label: "Desktop Screen Resolution (px)"
>      value: "1024x768"
> form:
>    - bc_vnc_idle
>    - desktop
>    - bc_num_hours
>    - bc_mem
>    - bc_num_cores
>    - bc_num_slots
>    - node_type
>    - bc_account
>    - bc_queue
>    - bc_vnc_resolution
>    - bc_email_on_started
> submit: "submit/my_submit.yml.erb"
>
> I tried variations of the attribute settings but nothing ever shows up.
> Is there something I am doing wrong here? I couldn't find any
> documentation on this option or reference browsing the source.
>
> Thanks,
>
> Eric
>
> _______________________________________________
> OOD-users mailing list
> OOD-users at lists.osc.edu
> https://lists.osu.edu/mailman/listinfo/ood-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osu.edu/pipermail/ood-users/attachments/20181030/130970f1/attachment-0001.html>


More information about the OOD-users mailing list