9

Now the tunnel works if I open the bitvise application and click the login button. I want to change that. I want the tunnel automatic open if open windows or restart windows

Where I can set the automatic tunnel to open when opening windows or restarting windows?

The options tab in the bitvise ssh client like this :

enter image description here

I'm still confused to set it?

Please help me

jww
  • 11,918
  • 44
  • 119
  • 208
Success Man
  • 271
  • 1
  • 4
  • 6

3 Answers3

15

The Bitvise SSH Client user interface does not provide an option to start the profile automatically when Windows 10 starts up. Instead, you can create a shortcut to Bitvise with the "-loginOnStartup" option. The steps below are a lot easier than creating a batch file.

  1. In your Bitvise Profile, select these options:
    • Uncheck "Open Terminal"
    • Uncheck "Open SFTP"
    • If using password authentication, check "Store encrypted password in profile"
  2. Click the "Save profile as" button and save the profile, e.g. to "%USERPROFILE%\Documents\BitviseProfile.tlp". You may see a message letting you know that sensitive information will be saved in the profile.
  3. Open the folder "%PROGRAMFILES(X86)%\Bitvise SSH Client" in one Explorer window, and the "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup" folder in another Explorer window. (If you copy and paste the locations into Explorer, they will automatically expand to the correct folders for your system.)
  4. Right-click on BvSsh.exe and drag it to the Startup folder, and select "Create shortcuts here" from the context menu. Rename the new shortcut like "auto-start bitvise ssh tunnel"
  5. Right-click the new shortcut and select "Properties"
  6. In the "Target" setting, enter the following, taking care to set the profile path to the actual path of your Bitvise profile:

    "C:\Program Files (x86)\Bitvise SSH Client\BvSsh.exe" -profile="C:\Users\Me\Documents\BitviseProfile.tlp" -loginOnStartup

  7. Click "OK"

  8. Double-click the shortcut and verify that Bitvise started up correctly
  9. You can also verify that if you go to "Startup Apps" in Windows Settings, you see an entry for "Bitvise SSH Client"
  10. Reboot windows and confirm that Bitvise started up correctly
humbads
  • 251
  • 2
  • 6
  • 2
    thank you, very helpful. in addition to -loginOnStartup option, two more command-line switches -exitOnLogout -hide=main will automatically close the terminal and GUI windows after the SSH session is terminated. – user1082 May 21 '19 at 15:30
  • Thanks @user1082. Those options can be selected from the profile though. I noted that in the answer. – humbads May 21 '19 at 17:44
  • Pheeew. Just saved me a crazy load of hours – Dawoodjee Jun 18 '20 at 19:42
0

You can add it to the startup group, so that it loads when you log in to Windows.

Last I checked, there was an issue where the System Tray icon wouldn't show up if the Bitvise SSH Client loaded before the taskbar itself was loaded. Because of that, I used a batch file and put a big sleep right into the batch file.

If Bitvise has fixed things so that it works if they load before the taskbar does, then you could do this with a Windows Shortcut as well. It would have to be a shortcut to BvSsh.exe, rather than to the saved connection, because you need to pass the -loginOnStartup parameter.

Obviously, this all requires that you have the connection set up so that you don't have to type an SSH password.

C:\Users\dyaw\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup> dir
 Volume in drive C is OS
 Volume Serial Number is 06C9-85F1

 Directory of C:\Users\dyaw\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

08/10/2018  01:43 PM    <DIR>          .
08/10/2018  01:43 PM    <DIR>          ..
05/26/2015  10:39 AM               319 Bitvise SSH Clients.bat
               1 File(s)            319 bytes
               2 Dir(s)  236,144,820,224 bytes free

C:\Users\dyaw\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup> type "Bitvise SSH Clients.bat"
@echo off

timeout 30 /nobreak

start "" "C:\Program Files (x86)\Bitvise SSH Client\BvSsh.exe" -profile=C:\Users\dyaw\Documents\server.tlp -loginOnStartup

REM Delay a bit so that the two icons are always in the same order in the System Tray
timeout 1 /nobreak

start "" "C:\Program Files (x86)\Bitvise SSH Client\BvSsh.exe" -profile=C:\Users\dyaw\Documents\linux.tlp -loginOnStartup

C:\Users\dyaw\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup>

Note: The directory shown above is the one for Windows 7. New versions of Windows may have moved the Start Menu.

David Yaw
  • 797
  • 2
  • 7
  • 13
  • I use windows 10. I tried running statements one by one like this : https://postimg.cc/image/ac1o3bibl/. Then I restart my windows. It just display like this : https://postimg.cc/image/gczd0hke9/. The tunnel doesn't automatically open – Success Man Sep 01 '18 at 05:34
  • Your batch file lists the filenames `server.tlp` and `linux.tlp`, in directory `C:\Users\[username]\Documents`, but your SSH Client shows that it loaded `C:\[something]\key\[something]\SFTP1_Profile.tlp`. Does the file server.tlp exist in your My Documents directory? Which file do you want to load & autoconnect? – David Yaw Sep 01 '18 at 22:15
  • Also, you have SFTP1_Profile.tlp set to connect via "publickey+password". This may require manual keyboard interaction, which would interfere with the auto-connection you're trying to set up. – David Yaw Sep 01 '18 at 22:26
  • Okay thanks. But this row : `start "" "C:\Program Files (x86)\Bitvise SSH Client\BvSsh.exe" -profile=C:\Users\dyaw\Documents\linux.tlp -loginOnStartup`. What is it used for? That seems unnecessary – Success Man Sep 02 '18 at 08:17
  • I change via "publickey". It's the same. If I restart windows, the tunnel still not open. I must click button login first – Success Man Sep 02 '18 at 09:05
  • What do you think? – Success Man Sep 03 '18 at 01:19
  • RE: What does this row do? It does the same thing as the first one, it loads the SSH Client and connects. I have two servers that I connect to, so I load two copies of the SSH Client. And did you change your script so that it loads your saved profile instead of my saved profiles server.tlp and linux.tlp? – David Yaw Sep 04 '18 at 04:21
  • Yeah, I just load my profile. Now it works. But the tunnel is not automatic. If I restart my windows, It will display like this : https://postimg.cc/image/6cdl97hul/. If I want the tunnel open, I must click login button first – Success Man Sep 04 '18 at 06:31
  • I'm using an older version of the SSH Client. (I'm using 7.29, you're on 7.45.) Perhaps the supported command line parameters have changed over time? What does running `BvSsh -help`, as the output window suggests, show? – David Yaw Sep 04 '18 at 16:40
  • Also, can you show the actual batch file you're running at startup? As of the last screenshot you showed, you had a link named "Bitvise SSH Client.lnk", which looks like a link to the program, not to your batch file. If you're just running SSH Client at startup, not the batch file, that would explain why it's not trying to connect at startup. – David Yaw Sep 04 '18 at 19:53
  • If I run `BvSsh -help` in the command prompt, the result like this : https://postimg.cc/image/u93tjht1j/. My start up like this : https://postimg.cc/image/ar963l6ef/ – Success Man Sep 05 '18 at 00:26
  • You only have a shortcut to the SSH Client Program in your startup group. Where did you put the command line I listed in my answer? Is it in that shortcut? If so, show the "Shortcut" tab of the shortcut's properties. – David Yaw Sep 05 '18 at 00:43
  • Look at this : https://postimg.cc/image/5ie55qiuf/. The command like that – Success Man Sep 05 '18 at 01:02
  • The shortcut tab like this : https://postimg.cc/image/uof3csx1z/ – Success Man Sep 05 '18 at 01:06
  • It looks like you have a shortcut to the SSH Client application only. It looks like it's loading the most recently used profile on startup. Create a batch file with contents similar to what I showed, and make a Startup shortcut to that, instead of to the application. – David Yaw Sep 05 '18 at 04:48
-2

You can use plink command-line tool from PuTTY package. And make it start with Windows.

Martin Prikryl
  • 21,071
  • 9
  • 77
  • 157