Why won't the VMs work anymore?

Problem

The Opal servers were working, but after switching them off and coming back to them you can no longer login or assign variables with datashield.login

The Opal servers boot all the way to the black screen showing:

dstesting-100-v4 login: _

In RStudio you can load all the required libraries:

> library(opal)
> library(dsBaseClient)
> library(dsStatsClient)
> library(dsGraphicsClient)
> library(dsModellingClient)

Login in fails, however:

> data(logindata)
> opals <- datashield.login(logins=logindata, assign=TRUE)

Logging into the collaborating servers
Warning: study1 will be excluded: Error in function (type, msg, asError = TRUE)   :
   Failed to connect to 192.168.56.100 port 8080: Connection timed out

Warning: study2 will be excluded: Error in function (type, msg, asError = TRUE)   :
   Failed to connect to 192.168.56.100 port 8080: Connection timed out

Solution 1

It may be the case that you need to wait longer before trying to use datashield.login.

The Opal servers take a little time to start up and for Opal to be ready.

Give it a few more minutes and try again. If that fails look at the solutions below.

Solution 2

The Opal servers can fail to work if they were not shutdown properly. This is likely to be the case if you have previous closed the Opal servers by clicking the 'cross' in the corner of the window and selecting 'poweroff the machine' or sometimes if you selected 'send machine the shutdown signal'.

Unfortunately, the best way to solve this problem is to:

(1) Remove the Opal servers from virtualbox. Simply right-click on them in the VirtualBox interface and select 'Remove', making sure you then select the option to 'delete all files'.

(2) Re-import the Opal servers from the .ova files you downloaded when setting up the test environment for the first time.

Preventing the problem

(1) After re-importing the Opal servers, take a 'Snapshot' of each of them. When shutting down the servers, poweroff the machine and select 'restore snapshot'.
See the Starting and Stopping the Opal Servers section of the Instructions for Windows and Mac users.

Or

(2) Shutdown the virtual servers manually.

First, login:

user
password

Then give the shutdown command:

sudo poweroff

This will ask you to re-enter the password and then the Opal server will shutdown cleanly.