Setting up SSH for WSL using Ubuntu, but can't edit ssd_config file with VSCode WSL2 window. It won't save - "operation not permitted"? - ssh

I'm following these instructions to set up LAMP on WSL. I got to step 3, and made the edits it instructed after "Make these edits:". However, after editing sshd_config using VSCode (in a WSL-2 window, which I figured might matter), I'm unable to save it and continue with the instructions.
VSCode first gives me this error popup when I try to save:
Failed to save 'sshd_config': Insufficient permissions. Select 'Retry as Admin' to retry as administrator.
And when I select "Retry as Admin", it gives another:
Failed to save 'sshd_config': Command failed: "C:\Users\smith\AppData\Local\Programs\Microsoft VS Code\bin\code.cmd" --file-write "c:\Users\smith\AppData\Roaming\Code\code-elevated-BmAuYzjZ" "\\wsl.localhost\Ubuntu\etc\ssh\sshd_config" Error using --file-write: EPERM: operation not permitted, open '\\wsl.localhost\Ubuntu\etc\ssh\sshd_config'
What do I need to do to be able to use VSCode to make the edits to this file? I don't want to be locked into only being able to use Nano for this or any project, so I'd be very thankful for some guidance.
UPDATE: I think I've made a little headway! I tried following this similar tutorial, but on this step, trying to add this file, I get an error. I think I'm lacking some kind of permission to change WSL files in Explorer at all.
I'll try to figure out how to do this before going further, and I'll report back if I'm successful.

Related

#1558 - Column count of mysql.proc is wrong. Expected 21, found 20. Please use mysql_upgrade to fix this error

I got this message when I try to run query on XAMPP in macOS
#1558 - Column count of mysql.proc is wrong. Expected 21, found 20. Created with MariaDB 100108, now running 100421. Please use mysql_upgrade to fix this error
I tried to write
'mysql_upgrade -u root -p'
on my terminal but I got this message
zsh: command not found: mysql_upgrade
I also ran into same issue and after cracking my head for the past 10hrs, I finally realise how to perform the upgrade. U
go to your Mac terminal and paste the following code:
Applications/XAMPP/xamppfiles/bin/mysql_upgrade -u root -p
Supply your root password and see it work like magic.
Contrary to what many people posted online by using /opt/lampp/bin
It always gives a zsh not found error.
I hope this helps you and in the future for others who might need it.
You could try switching to a different shell, say bash by typing bash in your terminal.
Then proceed to run mysql_upgrade normally in the appropriate directory
I also could not run the code from the Terminal. I was, however, able to go to the folder itself and "run" the mysql_upgrade application. If you are using XAMPP and the Application Manager, there's a button to Open Application Folder. If you click that, finder will open where XAMPP lives. Open the bin folder. Then scroll until you find mysql_upgrade. Double click it. It will run in a Terminal session and complete the upgrade. Hope this helps someone else as I spent waaayyyy too much time trying to get this to work.

Can't connect VS Code to Linux machine for remote development

I am getting this error on VS Code and have no clue why it fails
[15:14:59.543] Log Level: 2
[15:14:59.555] remote-ssh#0.51.0
[15:14:59.555] win32 x64
[15:14:59.560] SSH Resolver called for "ssh-remote+xx.xx.xx.xx", attempt 1
[15:14:59.561] SSH Resolver called for host: xx.xx.xx.xx
[15:14:59.561] Setting up SSH remote "xx.xx.xx.xx"
[15:14:59.621] Using commit id "0ba0ca52957102ca3527cf479571617f0de6ed50" and quality "stable" for server
[15:14:59.624] Install and start server if needed
[15:15:01.964] getPlatformForHost was canceled
[15:15:01.965] Resolver error: Connecting was canceled
[15:15:01.973] ------
Add one key in your settings.json as below. Please remember to replace the $remote_server_name to yours.
"remote.SSH.remotePlatform": {
"$remote_server_name": "linux"
}
Menu: File->Preference->Settings
Or click the icon to open settings.json:
In dialog box where you have typed user#host type/select Linux/Windows/etc. depends what you are using, then type/select Continue, then type password for remote session.
For those getting this error on Windows: Check if you have multiple ssh clients installed.
How I solved it was by adding my ssh-configuration to ALL ssh-config files.
In my case I had one in
C:\Users\USER_NAME.ssh\config (this is the one that the remote extension used to give me connection options)
and another in C:\Program Data\ssh\ssh-config
After adding my ssh-config setting to both I got the prompt to select virtual hosts' OS. Tried editing the settings.json file directly, but I think it gets confused because of the multiple ssh-configurations.
P.S.
Tested it for both private key and password enabled connections and it work with either.
I got a similar problem, but the error logs were bigger. Before that, I deleted the python and reinstalled it. Perhaps this led to the problem. Just reinstalled "Remote -SSH" extension in vscode and it worked for me.
In my case there were two files that look like
vscode-remote-lock.<user>.<xxx>
vscode-remote-lock.<user>.<xxx>.target
where was my remote user name and xxx the VS Code Remote Server build hash.
These two files on the remote server in the folder.
/run/user/1000/
I deleted both files and then VS Code came up right away. I have encountered this a few times now. VS Code Remote Server install is not very robust. I use it on about 7 remote machines and every once in a while something goes awry and it cannot recover from simple errors and gets stuck in installation loops.
This trick only works if there is a valid ~/.vscode-server on the remote machine with a hash that matches your local VS Code installation.
If you got here because you were trying to install VS Code in the first place and for whatever reason VS Code had issues with the remote installation, I highly recommend installing it manually by downloading and extracting the tar file to the remote machine directly.
I have tried playing with the setting "Use remote.SSH: Use Flock" and other tricks posted on StackOverflow but none of these work for me whenever I have remote installation issues. I cannot figure out why on some machines, a smooth remote installation is not possible. Even when all of my ssh keys and remote ids have been copied and tested from both the Windows command line and inside a WSL Ubuntu instance.
If VS Code Remote Server installation had slightly better error logic and better error messages none of us would be wasting hours doing this simple task.
I was getting the exact same error as the original poster received and yet none of the other answers were my issue.

GraphDB Failed to create JVM after attempting to change java options

Running GraphDB on windows.
I right clicked the icon, clicked settings. Tried to set Xmx512Mb, (so I mistyped, should have been Xmx512M). Now trying to run GraphDB says "Failed to create JVM", even after uninstalling and re installing.
Where can I find and undo what I typed in the settings if the UI is not starting up?
In other words, where is this configuration stored?
I removed AppData/Roaming/GraphDB and AppData/Local/GraphDB Free
Just to generalize it, If you set an invalid Java option parameter, GraphDB Free may fail to start after the application restart. The only way to solve this problem is to remove the invalid line from the file:
%userprofile%\AppData\Roaming\com.ontotext.graphdb.free\packager\jvmuserargs.cfg (Windows)
~/Library/Application Support/com.ontotext.graphdb.free/packager/jvmuserargs.cfg (Mac OS)
~/.local/com.ontotext.graphdb.free/packager/jvmuserargs.cfg (Linux).
In addition to Damyan's answer there is a GraphDB Free.cfg file in C:\Users\User\AppData\Local\GraphDB Free\app\ which you can edit.

Gluon Install DLL

When I attempt to install SceneBuilder I get the following error message. I've tried installing as administrator and using compatibility settings but neither solve my issue. I was wondering if you could assist.
C:\Users[User]\AppData\Local\SceneBuilder\packager.dll
An error occurred while trying to rename a file in the desination directory:
MoveFile failed; code 5.
Access is denied.
Click Retry to try again, Ignore to skip this file (not recommended), or Abort to cancel installation.
Retry does not work and if I ignore it, when I try to open an FXML file within Netbeans, nothing happens. Nor does anything happen when I manually try to run SceneBuilder.exe
This error occurs whether I use the default install location or not.
Has anyone else had this error, and if so how did you fix it?
I'm on Windows 10, and I'm trying to install SceneBuilder version 8.3.0.

Getting RPi-Cam-Web-Interface running

I followed the tutorial on this site, to get my RaspberryPi NoIR-Cam running. After starting it i am retrieving the following error:
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
sh: 1: /var/www/html/macros/error_hard.sh: Permission denied
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
This looks like a permission thing, but I executed
chmod u+x *.sh
just like they mentioned in the tutorial. Do you have any idea what I am doing wrong here?
Explanation: It is a permission problem, the RPi interface is trying to use the pi camera at the same time as something else, and that something else has root privileges.
I have used this interface before to stream PiCamera data into a webserver, and use three.js to render it and make it vr compatible. This RPi web interface is pretty frustrating for me. But, I have had that problem before. First, check your camera connection to the pi. To do this type raspistill -t 0 into the terminal. If it brings up a preview window, that is not the problem, if it doesn't bring up a preview window, fiddle with the connection and try again. Next, if that doesn't work, run ./RPi_Cam_Web_Interface_Installer.sh. This should bring up a crude GUI. Use your arrow keys to select number 4, or start camera. Once it starts, it should say 'started' next to it. You may get an error message at the bottom saying mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
sh: 1: /var/www/html/macros/error_hard.sh: Permission denied
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM) (or the same error you got). To fix this, close the terminal, open up a new one, and cd RPi_Web_Interface and then run again ./RPi_Web_Interface_Installer.sh select configure, enable autostart and camera. Then reboot. When the pi boots up, immediately open a terminal cd RPi_Web_Interface and ./RPi_Web_Interface_Installer.sh and check if the camera is started (you will know because the green started message will be next to the start option). If it isn't started, start it. IF you get the same error messages, I don't know what to tell you.
Had this exact error so:
ran sudo raspi-config and re-enabled the camera -problem went away