Tips for using a windows virtual machine on a mac

1881
3
Jump to solution
08-12-2016 06:15 PM
ChelseaUrsaner
New Contributor

I have been using Rstudio on my mac for a while now. Recently, I set up vmware to run a virtual Windows machine in order to use ArcGIS. Now I've discovered R - ArcGIS Bridge and I'm not sure what the best way to proceed is. Does anyone have a similar setup and can share tips?

Particularly, should I reinstall R/Rstudio on the Windows virtual machine, along with all the packages I've installed, and make Windows my main workspace? Or could I use Rstudio on my mac and still read/write to ArcGIS?

1 Solution

Accepted Solutions
ShaunWalbridge
Esri Regular Contributor

Hi Chelsea,


I use the R-ArcGIS bridge on a Mac, and can help answer your question. While the bridge does work with R and R Studio, as you suspected, it can't directly talk to your installation on the Mac side — the virtual machine doesn't have a direct way of communicating with applications running on the Mac side of your machine.

The easiest thing to do is to install R and RStudio on the Windows VM, and install the same packages into that environment. You can get a list of your current packages with the installed.packages command:

  installed.packages()[,"Package"]

Then you can copy that list into a vector, and install it on the Windows installation of R with

  install.packages(c("mgcv", ...))

Where the character vector c("mgcv", ...) is the list of your installed packages from the first step. That should get you the same environment in both your Mac and the Windows virtual machine, and let you run the same R packages (though you'll need to work on Windows when working against data sources which use the bridge).

I hope that helps, and let us know if you have any further questions or issues.
Cheers, Shaun

View solution in original post

3 Replies
ShaunWalbridge
Esri Regular Contributor

Hi Chelsea,


I use the R-ArcGIS bridge on a Mac, and can help answer your question. While the bridge does work with R and R Studio, as you suspected, it can't directly talk to your installation on the Mac side — the virtual machine doesn't have a direct way of communicating with applications running on the Mac side of your machine.

The easiest thing to do is to install R and RStudio on the Windows VM, and install the same packages into that environment. You can get a list of your current packages with the installed.packages command:

  installed.packages()[,"Package"]

Then you can copy that list into a vector, and install it on the Windows installation of R with

  install.packages(c("mgcv", ...))

Where the character vector c("mgcv", ...) is the list of your installed packages from the first step. That should get you the same environment in both your Mac and the Windows virtual machine, and let you run the same R packages (though you'll need to work on Windows when working against data sources which use the bridge).

I hope that helps, and let us know if you have any further questions or issues.
Cheers, Shaun

ChelseaUrsaner
New Contributor

Thank you Shaun! Very helpful

RachelField
New Contributor II

Hi Shaun,

You recently helped me on the subject 'Cannot install R-bridge on Parallels virtual machine'.

Although, thanks to you, 'arcgisbinding' now appears in my list of packages in R Studio, I get the following error messages when I try to load it:

ERROR#1 (pop-up "rsession.exe - Entry Point Not Found"):

"The procedure entry point AddDIIDirectory could not be located in the dynamic link library KERNEL32.dll."

ERROR#2 (R console):

Error: package or namespace load failed for ‘arcgisbinding’: 
.onLoad failed in loadNamespace() for 'arcgisbinding', details:  
call: inDL(x, as.logical(local), as.logical(now), ...)  
error: unable to load shared object '//Mac/Home/Documents/R/win-library/3.5/arcgisbinding/libs/x64/rarcproxy_pro.dll':  
LoadLibrary failure:  The specified procedure could not be found.

I realized all of my other R packages were installed in my mac OS, so I attempted the 'install.packages(c("mgcv", ...))' solution you provided above to move them to the Windows VM. It worked for all packages EXCEPT arcgisbinding. Any suggestions for a fix would be greatly appreciated.

Thank you again,

Rachel

0 Kudos