-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot build VMs from Windows 10 #32
Comments
Do you have an SSH client installed on the same machine? That is how its "supposed" to work, but I don't have a Windows machine to test it upon. Its only not an issue on Mac/Linux as they have one pre-installed. I'm not too familiar, but a quick Google gave this as a possibility: https://www.windows-commandline.com/windows-command-line-ssh/ The R script will call the system with "ssh" so if you can use ssh from the Windows Terminal, then it should work. |
Another alternative would be to launch an instance in GCE, log into that with something like |
Okay, I think getting SSH to work properly on Windows is not worth the time ATM. But how would you go about building e.g. sample Shiny app after using |
It should just be a case of downloading and installing a SSH client. Without that, you can't use any SSH functions including the docker ones, but will be able to use the VM creation functions. The alternative is to start up a build instance, use That is a good candidate for a new template I could include, a bit meta, but I will look at making it easier for these situations. |
If RStudio installed on Windows, should have ssh client available via |
@terzieff @nickshffer do you have a Windows machine handy to test this? It looks as if you can use the SSH bundled with RStudio and configure its SSH RSA Key in RStudio on Windows via the "Git/SVN" menu under Options. I can't change the location of this key on OSX (is that the same on Windows?) but it could be that you can use this SSH key to connect. (or create a new one) That would require you to run first the It doesn't specify but the public key should be saved in same folder as Add the Windows ssh client to your PATH variable e.g. Then upload the ssh keys to the VM: vm <- gce_ssh_addkeys(vm, key.pub = "C:\\.ssh\id_rsa.pub", key.private = "C:\\.ssh\id_rsa")
gce_ssh(vm, "echo foo") Let me know if this gets you past authentication. |
Great solution, I can probably take a look later tonight. |
I've tryed this solution, but i get this error...
R Installed on my Windows10 PC , authenticated with gcloud compute engine ssh Someone can help me? thanx in advance. |
The issue for docker containers specifically is going to be sorted out when That won't solve general SSH connection issues, but that can then be mitigated by using |
Hi @atauro - it doesn't look like your SSH request is using the RStudio SSH keys - did you run this? vm <- gce_ssh_addkeys(vm, key.pub = "C:\\.ssh\id_rsa.pub", key.private = "C:\\.ssh\id_rsa")
gce_ssh(vm, "echo foo") |
Also, may as well put this here since you can log in and build the image yourself whilst the fix is pending: Upload the folder container the For Windows follow these instructions for uploading to your instance, or use gcloud Log in to the instance via Build the new docker image via:
|
I've added a new template you can use to build images, rather than needing to SSH into a VM yourself. Here is an example: ## this could be any Dockerfile, here it takes one that comes with package
my_file <- system.file("dockerfiles","googleAuthR-verse", "Dockerfile", package = "googleComputeEngineR")
gce_vm_template("builder",
dockerfile = my_file,
build_name = "test1builder",
name = "builder",
predefined_type = "n1-standard-1") You supply the Dockerfile to build from and what to call the docker image on Google container engine, and it will launch a VM with the cloud-config configured to import the Dockerfile and build the image, then upload it. You should delete the build VM after it is done. |
I believe this specific issue is solved now, but the more general using SSH from Windows I'll track here: #35 |
NTS - Adding Env in windows: You need to locate the directory that ssh.exe is in. You then need to go into System Properties (hit WINDOWS KEY+PAUSE), go to Advanced system settings, click Environment Variables... Scroll down in the scrolling window at the bottom, until you see "Path" under "Variable". Click it, click Edit... Go to the end of the value, add a semi-colon if one isn't there already, and type the path to the directory that ssh.exe is in. |
RStudio settings: Tools > Global Options > Git/SVN > Create RSA Key (leave password blank) it will appear in C:/Users/USERNAME/.ssh/id_rsa Make VM object and add the SSH keys to it:
|
Usernames with spaces won't work, set your own. |
Hey,
after following the documentation (creating VM and adding valid SSH keys) and trying to use docker_build() (for a Shiny app, but that's not important, I guess), I was getting this:
Error in cli_tools() : ssh, scp not found on your computer Install the missing tool(s) and try again
I dived into the code, went to analogsea docs and found these issues/solutions by Hadley - pachadotdev/analogsea#81 pachadotdev/analogsea#88
After adding "C:\Program Files\RStudio\bin\msys-ssh-1000-18" to the PATH variable and getting excited, I went to another error:
Permission denied (publickey). Error: ssh failed ssh -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=C:\Users\Tomek\AppData\Local\Temp\Rtmpsdfqdz/hosts -i C:\Users\Tomek\Desktop\Projekty\shiny\my-ssh.ppk [email protected] "mkdir -p -m 0755 buildimage" In addition: Warning message: running command 'ssh -o BatchMode=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=C:\Users\Tomek\AppData\Local\Temp\Rtmpsdfqdz/hosts -i C:\Users\Tomek\Desktop\Projekty\shiny\my-ssh.ppk [email protected] "mkdir -p -m 0755 buildimage"' had status 255
, which seems to be similar to another analogsea issue: pachadotdev/analogsea#114I'll be able to test the package on Mac next week and while I expect it to work, it would be great to find a way to fix the SSH connection on Windows.
The text was updated successfully, but these errors were encountered: