So I created an Express server with express generator. When I run the server on my laptop's Ubuntu for Windows, it starts up fine. Now when I run curl localhost:3000 in a separate terminal, I get the message curl: (7) Failed to connect to host localhost port 3000: Connection refused.
The strange thing is that when I take that exact same server and run it on my Desktop's Ubuntu for Windows, running the curl command above works fine.
Here is where it gets even stranger, when I run the server on git bash on my laptop, the curl command also works fine. Note, the curl command will work fine in either git bash or WSL if the server is running on git bash.
I have no clue why the server will not work properly on my laptop's Ubuntu for Windows. I thought WSL just uses Window's network, so why would running the server on git bash work properly, but not on WSL?
Googling this has not given me much help. I have uninstalled WSL and reinstalled. I have also tried running all the commands with sudo. None of that worked.
Related
I am trying to install MSSQL-Server on my Ubuntu 22.04. I know that it does not currently support Ubuntu 22.04. I need to find a workaround to install the software as I don't want to downgrade.
I tried installing but it keeps giving me dependency errors. How do I solve it? Any help would be appreciated.
Unfortunately, at this time, SQL Server 2019 only works on Ubuntu 20/21. 22.04 is not supported at this time.
So either you will have to use Ubuntu 20 or, as others have stated, use Docker Containers.
You can install Docker into Ubuntu 22.04. It's a multi-step process, but it isn't that difficult.
Install Docker Engine on Ubuntu (follow the Install using the repository section)
https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository
Install SQL Server Container
https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-ver15&pivots=cs1-bash
That should do it.
Also, in link #2, read further below on how to connect to your docker image to run SQLCMD from within the container.
Like SQL Server 2019, you cannot install the SQLCMD tools directly into your Ubuntu 22.04 installation. But the Docker container image contains the sqlcmd tool for you to be able to connect to the database.
Or, you can use Visual Studio Code with the SQL Server (mssql) extension and it can connect to your SQL Server instance in your running Docker container.
The connection string would be:
"Server=localhost;Database=your database name;User Id=user id;Password=password"
You can leave out the Database setting if you just want to connect to the default database.
If you create any databases, you can then connect to them directly by specifying the name.
I also have same problem like this. I also tried downgrading Openssl to 1.1.1k and 1.1.1s but still not works. And finally I found this explanation
https://github.com/microsoft/msphpsql/issues/1419#issuecomment-1303626500
So, keep use OpenSSL 3.0.2 and you just need to change the SECLEVEL to 0 instead of 1 in /etc/ssl/openssl.conf
[system_default_sect]
CipherString = DEFAULT:#SECLEVEL=0
And it works, now I can connect to SQL Server using Ubuntu 22.04.
Looked at this
and it has worked for me!
So worth giving it a shot
cd /opt/mssql/lib
ls -la
sudo rm libcrypto.so libssl.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 libcrypto.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.1 libssl.1.1
If libssl is not installed, try:
sudo apt install libssl1.1
Update: I had issues connecting using libssl1.1, so I switched to 1.0 after performing the previous steps, so I also did the following:
sudo systemctl stop mssql-server
sudo systemctl edit mssql-server
Added:
[Service]
Environment="LD_LIBRARY_PATH=/opt/mssql/lib"
Then:
sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 /opt/mssql/lib/libssl.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /opt/mssql/lib/libcrypto.so
Then started mysql-server and things just worked fine!
I need to download a file over SSH (scp) from Ubuntu machine A to ubuntu machine B.
I don't have a root access on the machine from I am downloading the file (machine B), so I cannot install anything like sshpass etc...Just clear Ubuntu.
I need to use password authentication because the command will be called inside TeamCity plugin which does not support downloading over SSH (just uploading) or plain bash. I don't have priviledge to read SSH private keys from command line.
Finally, I found that Docker is a solution for it. I was lucky that docker is installed on this machine and I can install anything (including scp) inside docker even if I am not root on the host machine.
So I am facing a very strange peculiarity. I am trying to run dpkg on a remote server via SSH. My code works perfectly if I click Run through Xcode, but if I click Build > Archive then Export as a Mac Application, all SSH commands sent to the server work, other than "dpkg". Any ideas why this might happen?
Apparently, after many days of facing that issue, I tried installing via dpkg a Deb that was already located on my server and it worked. What's even more strange is that while scp would transfer the file, dpkg would just not use it! What made the trick was getting the file via curl and then running dpkg normally. No idea why that's the case though, as both Deb files had the same owner, group and permissions. And both were running by root, so it wasn't a permission error.
I am trying to start docker from winodws7 enterprise edition.
boot2docker start
results
Waiting for VM and Docker daemon to start...
..........................................................................oooooo
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
Started.
Trying to get Docker socket one more time
Error requesting socket: exec: "ssh": executable file not found in %PATH%
Docker client does not run on Windows for now. Please use
"boot2docker" ssh
to SSH into the VM instead.
I tried this link. But All answers doesn't help me. I have re-installed the boot2docker and powered off boot2docker-vm in Virtual machine and restarted. Virtualisation is enabled in my bios. My Sys has better capabilities.
Using 1.4.1 version.
Please Some Suggestions?
As boot2docker complained, you don't have ssh in your path. Please add ssh.exe into Windows path (it might not be visible, but boot2docker installation includes msys-git installation which includes ssh.exe, so you need to add Git installation directory in path, e.g.
c:\Program Files (x86)\Git\bin
I have installed Vagrant, PuTTY, PuTTYgen and Virtual Box and I now want to
open a SSH connection to my virtual machine with the windows command prompt.
Every time I want to open the connection with the vagrant sshcommand I get this error:
vagrant ssh
`ssh` executable not found in any directories in the %PATH% variable. Is an
SSH client installed? Try installing Cygwin, MinGW or Git, all of which
contain an SSH client. Or use the PuTTY SSH client with the following
authentication information shown below:
I already know about the possibility to install "Git" to solve this problem!
I was wondering if its possible to use PuTTY in combination with the command vagrant ssh instead of OpenSSH!
For example:
With a batch file or something to ajust the syntaxes.
There is an official thread for Vagrant here which ended in no result AFAIR. But when googling for "vagrant putty" there seem to exist many plugins for Vagrant bringing that functionality, maybe through "hacks".
For reference: vagrant-multi-putty. Worked for me too on Windows after two simple commands: vagrant plugin install vagrant-multi-putty and vagrant putty (only for Vagrant 1.1 and newer),