nofail SSH Mounting in fstab

The following /etc/fstab entry is placed on your client machine, connecting you to your remote machine using SSH keys:

Note that sshfs will have to be installed on your client in order for this to work. This can be done through your distro’s package manager.

sshfs#{REMOTE}@{IP_ADDRESS}:/mnt/{REMOTE_DIR} /mnt/{CLIENT_DIR} fuse ServerAliveInterval=1,reconnect,port={PORT},defaults,_netdev,IdentityFile=/home/{CLIENT}/.ssh/id_rsa,allow_other,nofail 0 0

The port option can be ommited if the default SSH port is used.

The nofail option is important. If you client can’t connect for whatever reason, your entire system won’t halt due to a boot failure.

reconnect and ServerAliveInterval=1 are also important. These are used to ensure your machine doesn’t halt in case the server/remote disconnects while the connection is in use.

Mounting libvirtd Over SSH

I recently took part in a QEMU/KVM installation. I tried adding the connections from my client machine to the internet connected server. This server runs the ssh daemon on a port other than 22. For some reason, there’s no way to do this in the virt-manager GUI. Thankfully, you can do it via the command line by running the following:

virt-manager -c ‘qemu+ssh://${USERNAME}@${IP_ADDRESS}:${PORT}/system?keyfile=${PRIVATE_KEY_PATH}’

SAP PO Release Checklist

Legend

Sender and receiver adapters of certain types use the following colors:

  • SFTP
  • REST

Scenarios

Sender -> Receiver(SFTP -> SFTP)

Sender ->

Source tab
SFTP Server section
  1. Verify Server.
  2. Verify Server fingerprint.
    • This should either be set, or bypassed using a * (wildcard) if I don’t have it.
Authentication section
  1. Verify that valid Usernames and Passwords are used, and meet the length of the one provided.
    • This should be checked multiple times.
File section
  1. File name should look like the following: ZFILENAME_TEST_*.*
    • Note: *.* is important here if using ASMA filename in receiver.
  2. Verify that a proper Directory is used.
    • Check that the directory used exists on the server as well. This should be done from the PO OS level using the sftp command.
Processing tab
Processing Parameters section
  1. Verify that Delete file is either checked or unchecked.
  2. Verify that Archive faulty files is either checked or unchecked. Ensure that the value it holds is correct.
Advanced tab
Adapter specific message attributes section
  1. To use the Sender filename in the Receiver channel, ensure Set adapter specific message attributes (ASMA) is checked, and File name is checked. All other check boxes in the adapter specific message attributes section should be unchecked.

-> Receiver

Source tab
SFTP Server section
  1. Verify Server.
  2. Verify Server fingerprint.
    • This should either be set, or bypassed using a * (wildcard) if I don’t have it.
Authentication section
  1. Verify that valid Usernames and Passwords are used, and meet the length of the one provided.
    • This should be checked multiple times.
File parameter section
  1. Filename should look like the following: .*
    • Note: *.* is important here if using ASMA filename in receiver.
  2. Verify that a proper Filepath is used.
    • Check that the Filepath used exists on the server as well. This should be done from the PO OS level using the sftp command.
  3. Verify that Create Directory is either checked or unchecked. Typically, this should be checked.
  4. Verify that Overwrite is either checked or unchecked. Typically, this should be checked.
Processing tab
Processing parameter section
  1. Verify that Add Timestamp to filename is unchecked. This is required for ASMA.
Advanced tab
Adapter specific Message-Attributes section
  1. Verify that Use Adapter specific Message-Attributes is checked.
  2. Verify that Filename is checked.

Autostart VMWare Workstation Pro VMs on Windows

Create a .bat file with the following file content. Make sure you point to the .vmx file of your VM.

“C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe” -T ws start “Z:\virtual_machine\virtual_machine.vmx” nogui

Move this .bat file to your startup folder at the following location: C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup.

WSL 2 Setup

WSL 1 is fantastic, but lacks some of the features (namely fstab mounting) that WSL 2 brings to the table. WSL and WSL 2 are a bit confusing to set up because of the lack of centralization; “Go to the Windows Features panel, then download this random EXE from a browser…”.

There are multiple ways to go about conducting this, but here’s the simplest way to set up both versions.

Install WSL 1

Open PowerShell as administrator (Shortcut: Windows + x, then hit a, then Alt + y).

Put these two commands into the PowerShell window:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Hit enter a few times.

Once the commands are done running, restart your computer. Yes, you’re still forced to restart Windows in 2022 for feature additions.

Now, you must choose a distro. I prefer Debian. The other installations are the same process, so choose whatever. You have two options depending on your Windows 10 version:

  • Windows Store download (the easiest)
  • Internet download -> Add-AppxPackage import (for Windows 10 LTSC users)

Windows Store Method

Just type the distro you want into the search bar – like Ubuntu – and hit the installation button. When that’s done, open the distro EXE you downloaded from the MS store and go through the installation process. You can find it by hitting the Start button and typing the distro name.

Internet Download

Skip this step if you’ve already done the Windows Store Method.

Click one of these distro links:

That should be all of the officially supported ones hosted by Microsoft.

After the download, open a PowerShell window as administrator once again. Then, navigate to the directory you downloaded the appx file at (probably your downloads directory), then run the following command (note: the file name will be different depending on your distro):

Add-AppxPackage Debian.appx

Then, run the newly installed EXE on your system. If you installed Debian, run the Debian program, if you installed Ubuntu, run the Ubuntu program, and so on. Go through the setup process until your new user is created.

That’s WSL 1 + distro installation complete. Now we can convert this WSL 1 distro to WSL 2 to get those oh-so-fantastic features.

WSL 2 Installation

Open a PowerShell window as administrator once again. Run the following command (note: the file name will be different depending on your distro):

wsl --set-version Debian 2

This will take a minute, but once it’s done, you’ll have WSL 2. Easy as that.