unable to run virtual machine through vagrant up - github

I tried to run a virtual machine through vagrant over VirtualBox. I installed VirtualBox and then Vagrant. Then, I cloned a repository from github using git clone http://github.com/<username>/fullstack-nanodegree-vm fullstack. Then, I changed directory to fullstack . In the git shell, I then run vagrant init and then tried to add box using vagrant box add hashicorp/precise64 but I got error as shown in the screenshot.
Then, I tried adding box using vagrant box add hashicorp/precise64 --insecure and I got this result.
Then, I ran vagrant up and then vagrant ssh. But, Still git shell is suggesting to run vagrant up again.
Please suggest something.
EDIT: After moving my project to C:\Nanodegree, I ran vagrant up and vagrant ssh but still getting problems.

The issue is due to ruby bug with directory with spaces.
Move your project out of the $USER_HOME directory or choose to have your username without any space (it will save you some issues if you have to work with some Linux tools)
Your Vagrantfile does not contain any information about the box to be used.
make sure to edit your Vagrantfile and have the following line in the file
config.vm.box = 'hashicorp/precise64'
NB: Its better to copy/paste the text of your terminal rather than having screenshot.

Related

code tunnel -h doesn't list options and doesn't open a tunnel to WSL

I'm following the guide
and I am noticing that code tunnel -h in a ubuntu terminal window just launches the code UI.
Using the command palette to get the URI results in a tunnel to my Windows version of VSCode rather than the WSL:ubuntu (which is the one I care about)
How do I fix this?
It appears that, for now, you need to manually install the CLI in WSL in order for it to work. The downloads can be found here. Since you are on Windows, I would recommend the x64 CLI download. When you extract the tar.gz file, you will get a file named code. I would recommend moving it to your home directory for ease. To open the tunnel, run ./code tunnel (from wherever you put the code file) to force the new CLI. If you use code tunnel it will still use the Windows version.
Source: https://github.com/microsoft/vscode/issues/171196

PhpStorm in Ubuntu can't detect pd_dump executable on PostgreSQL Export

My environment:
Ubuntu 20.04.3 LTS on Windows 10
-> https://www.microsoft.com/store/productId/9NBLGGH4MSV6
PhpStorm 2022.1 Build #PS-221.5080.224, built on April 13, 2022
My Problem:
I'm trying to export a PostgreSQL database inside the Database tab of PhpStorm.
To execute the export I right click the database in the list and click on the "Export with 'pg_dump'" option. This opens the Export window with all the options and command preview:
Inside of the window I get the error message "Path to executable is wrong" even tho the pg_dump file exists at the given path /usr/bin/pg_dump. This stops me from executing the export.
I have tried to manually install pg_dump in another directory and select it in the PhpStorm Export window, but it still won't detect the executable. The executable itself works fine.
The solution to this problem was to do a sudo apt-get install postgresql-client.
Apparently there is a general problem with the pg_dump executable of the "postgresql-client-common" package:
https://askubuntu.com/questions/501091/command-pg-dump-not-found
After installing the postgresql-client package, everything works fine in PhpStorm as well.
The code is pretty simple there: IDE checks that file exists and is executable, then run /path/to/pg_dump --version command and parse output looking for some keywords. Unfortunately there are no logs which can show exact reason, but I guess the issue that IDE can't get access to the file. Most likely due to WSL. The workaround is to install IDE and unpack PG binaries on Windows, then configure port forwarding to make PG server accessible from host OS.

Is it possible to open VSCode from Windows terminal while SSH'ed into a virtual machine?

I'm working on some tutorials and trying to do something, but no idea if it can be done. I am using windows terminal in Windows 10. I have an Ubuntu virtual machine running.
I'd like to:
Open Windows terminal
SSH into the Linux Virtual Machine
Type in the code . command and have it open a version of VS Code on my Windows PC that is working on the folder in the Ubuntu VM.
I tried install code locally and on the command line in the other machine, but it doesn't work. I am sure there are other ways to do this but wanted to explain how I was doing it to show I at least tried something. Thanks for your help.
It's not quite as easy as the code . technique you get with the Remote - WSL extension, but Microsoft also provides a Remote - SSH extension that can be used to directly access the remote machine (without requiring WSL in-the-middle).
Once the Remote - SSH extension is installed in VSCode (and it may have already been installed in an extension pack with the WSL extension), and you have installed an OpenSSH client in Windows, there are several ways to access files on the remote host through SSH:
From the Command Palette (Ctrl+Shift+P), type Remote SSH to filter on those commands. From Connect to Host, you can add a new configuration, etc.
From the Activity Bar on the left, select the Remote Explorer icon, then in the dropdown at the top, select SSH Targets. You can add hosts here through the + icon.
There's a direct shortcut to Open a Remote Window at the far left of the status bar. This will give you similar filter options on the Command Palette as above.
Once a host is configured, you can browse it just as (well, almost) if it were local, open files, edit, etc. The one thing you can't do (as far as I'm aware) is any type of sudo/su editing on files that you don't have permissions to directly.
Full details in the VSCode docs here.

Changing Jupyter Notebook start location [Win 7 Enterprise]

I am trying to change the default Jupyter Notebook start directory on my Windows 7 Enterprise machine. Other answers have suggested changing the "Start In" field found through Right-click>Properties>Shortcut on the Jupyter program in my Start menu, however this doesn't have any effect. When I change this field to my desired directory and try running the program it still opens in the default directory, when I recheck the "Start In" field it is the same as whatever I had changed it to so it looks like it isn't being changed back by Windows, rather it's being disregarded entirely. For reference the default directory is at P:\ which is not a local directory and is hosted on my company servers, and I am trying to change the Jupyter startup directory to C:.
I'm sure the path is correct - I've tried a few different ones and they are working with autocomplete. I should mention this is a locked down corporate machine and I have to run Jupyter as administrator or else it exits immediately. I do have elevated rights and have checked the user permissions on Jupyter. This is using the Jupyter that comes as default with the current Python 3.5 distribution of Anaconda - I have also tried reinstalling the whole Anaconda package and I'm currently working with a fresh default install.
I am wondering if there is perhaps a way through changing the startup script that is run when you execute the program?
Found the solution - go to your Anaconda install directory (for me this was C:\Anaconda3) and open the file cwp.py in a text editor. Change the line
os.chdir(documents_folder)
to
os.chdir("C:\\my\\path\\here").

Setting up Vagrant Windows

I am new to vagrant and I keep getting this error.
How can I properly run vagrant up so that I can continue with the setup process?
so once you have Vagrant and VirtualBox installed, the next steps are to create a Vagrantfile which basically is the configuration file for the VM you will build. It contains box information as well as network, sync folder and any provisioning you'll do on the VM.
for example, if you want to create an ubuntu VM:
$ vagrant init <ubuntu/wily64>
$ vagrant up
The first command (vagrant init) might take some time as it will download a VM from internet but you only run it once. then vagrant up will boot the VM