-
Star
(390)
You must be signed in to star a gist -
Fork
(73)
You must be signed in to fork a gist
-
-
Save xbb/4fd651c2493ad9284dbcb827dc8886d6 to your computer and use it in GitHub Desktop.
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface. | |
You can use the user and password that you use for the web interface. | |
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS. | |
You don't need to install it, just extract it or copy the files in "jre" folder. | |
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor. | |
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture. | |
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs. | |
If you don't see the MacOS libs in the file make sure you download it from MacOS. | |
Edit the bat/sh file according to your needs. | |
The file structure should look like this: | |
start-virtual-console.bat (.sh if Linux/MacOS) | |
avctKVM.jar | |
jre/<jre home here> | |
lib/avctKVMIO.dll (.so if Linux, .jnilib if MacOS) | |
lib/avmWinLib.dll (.so if Linux, .jnilib if MacOS) |
@echo off | |
set /P drachost="Host: " | |
set /p dracuser="Username: " | |
set "psCommand=powershell -Command "$pword = read-host 'Enter Password' -AsSecureString ; ^ | |
$BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^ | |
[System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)"" | |
for /f "usebackq delims=" %%p in (`%psCommand%`) do set dracpwd=%%p | |
.\jre\bin\java -cp avctKVM.jar -Djava.library.path=.\lib com.avocent.idrac.kvm.Main ip=%drachost% kmport=5900 vport=5900 user=%dracuser% passwd=%dracpwd% apcp=1 version=2 vmprivilege=true "helpurl=https://%drachost%:443/help/contents.html" |
#!/bin/bash | |
echo -n 'Host: ' | |
read drachost | |
echo -n 'Username: ' | |
read dracuser | |
echo -n 'Password: ' | |
read -s dracpwd | |
echo | |
./jre/bin/java -cp avctKVM.jar -Djava.library.path=./lib com.avocent.idrac.kvm.Main ip=$drachost kmport=5900 vport=5900 user=$dracuser passwd=$dracpwd apcp=1 version=2 vmprivilege=true "helpurl=https://$drachost:443/help/contents.html" |
thanks for the script. successfully implemented for an R710 with idrac enterprise 6 on a windows 10 64 bit machine.
was driving me batty why i couldn't get the console running with java 8, but your script is a neat workaround and runs perfectly.
You don't NEED an old Java, you just need to disable all the SSL/TLS restrictions in ($javadir)/lib/security/java.security - specifically, set jdk.tls.disabledAlgorithms=DES
and jdk.certpath.disabledAlgorithms=MD2
(You may want to leave others there, but that's enough to get it working).
You probably also want to disable TLS1.3 in Java Settings -> Advanced, as that can cause problems with HP ILOs, too.
Worked great on my R810 with iDrac6 Enterprise.
Just a note for anyone else that might have this problem... I was getting an SSL socket exception in Java. The only thing I changed was the password I was using for the user. Turns out I had a few special characters in the password. That was the issue. Once I removed the special characters everything worked perfectly.
iDrac5 Success:
On MacOS Catalina
- Java JDK 7u80
- Edit
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/security/java.security"
and comment outjdk.tls.disabledAlgorithms=SSLv3
at the very bottom.- If your path is different,
sudo find /Library -name "java.security"
- If your path is different,
- Download
https://<ipaddr>/plugins/vkvm/avctDRAC5Viewer.jar
- Get the latest vkvm.jnlp (current login, credentials expire). Replace
<ipaddr>
with your IP Address awk 'NR == 12 {print substr($0,16,32)}' ~/Downloads/vkvm.jnlp | xargs -I {} /usr/bin/java -cp avctDRAC5Viewer.jar -Djava.library.path=./lib com.avocent.drac5.kvm.Main ip="<ipaddr>" kmport=5900 vport=5901 user={} passwd= apcp=0 sslv3=1
awk 'NR == 12 {print substr($0,16,32)}'
prints line 12, chars 16-32, which contain the hashed username.- Be sure you're in the same path as
avctDRAC5Viewer
- Change
kmport
andvport
accordingly. (also available inside the vkvm.jnlp file). - Using the jnlp username, you do not need a password. Leave as
passwd=
Thank you. It works for me
Thank you very much it works!
Yes it works for me too. Thanks.
Thanks for that great script!
I have IDRAC8, and original script didn't work. So I played a little bit, tried this and that, and finally it works! My configuration and what did I do:I used Java 1.8 (64-bit in my case). Changed "java.security", as @krubottom advised (and BIG THANKS for that!) - withou it I got an Error.
...
VMAPI_DLL.dll - from avctVMAPI_DLLWin32.jar (or avctVMAPI_DLLWin64.jar - for 64)
Thanks for sharing. I used procexp (from sysinternals) to determine I needed a VMAPI_DLL but did not know what to pull from the server. Is it a safe bet to assume that the path to the .jar
will always be the DLL
filename, minus the .dll
then prepend avct
and postpend Linux64.jar|Win64
?
I'm hoping that when I get a server that has a newer iDRAC version it will be this simple.
Thank you, this worked on linux mint w/ default java 8. Fwiw instead of editing the system-wide security policy (eg. /usr/lib/.../security/java.security) you can copy the file into the local directory and tell the script to use it by adding "-Djava.security.properties=./java.security" to the java arguments. Then the security settings will only apply for this particular application, hopefully avoiding potential security risks.
Thank you! It works for me too.
I made a Python script based on this. Should work for Win/Linux/Mac.
Hi, How can I get avctKVMIO.dll and a vmWinLib.dll?? I downloaded from google avctKVMIO.dll and get vmWinLib.dll from my java ultimate version installed in appdata\LocalLow\Sun\Java\Deployment... but I get a error message: "The native library for keyboard and mouse support failed to load. Pass all keys to server and single cursor support will not be available", and not run, I´m under win10 x64, thanks
@codigobinario did you fix it?
Hi,
I have read through all the comments and tried all solutions.
i am still getting this error
Jun 13, 2020 7:01:07 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
06/13/2020 07:01:07:627: Starting client.
====setPowerMenuStatus: (##2)
06/13/2020 07:01:12:937: Connection failed with exception: Connection refused: connect
I am using JRE 7 on Windows 10.
I can download the viewer.jnlp fresh from the webGUI and it works.
I have change the SSL v3 statement in the security file.
I have added both Drac IP + Port 443 and Drac IP + Port 5900 to the allowed domains.
Any suggestions.
Toby
Thank you very much, it saved me hours and hours of headaches! To get the jar files from the idrac6 server, I had to use (with wine) an old Firefox (from 2011), so I didn't have to compile openssl and wget to allow sslv3 to work!
$ tree
.
├── avctKVM.jar
├── avctKVMIO.jar
├── avctKVMIO.jnilib
├── avctKVMIOMac64.jar
├── avctKVMIOMac64.jnilib
├── avctVM.jar
├── avctVM.jnilib
├── avctVMMac64.jar
├── avctVMMac64.jnilib
├── lib
│ ├── avctKVMIO.dll
│ ├── avctKVMIO.jar
│ ├── avctKVMIO.jnilib
│ ├── avctKVMIO.lib
│ ├── avctKVMIO.so
│ ├── avctKVMIOMac64.jar
│ ├── avctKVMIOMac64.jnilib
│ ├── avctVM.jar
│ ├── avctVM.jnilib
│ ├── avctVMMac64.jar
│ └── avctVMMac64.jnilib
├── start-virtual-console.sh
└── viewer.jnlp
1 directory, 22 files
I'm not sure how to find out what its looking for...
NativeKeyboard.init() Native library loading [avctKVMIO]
iDracViewerObjectFactory: Failed to load native keyboard library.
Exception: no avctKVMIO in java.library.path
Library path=./lib
I wish it would say, I am looking for a file named x so I can name it that.
If anyone is here trying to get this to work with an Avocent/Dell KVM switch, I was able to get it to work using a similar methodology.
I probably overdid it with duplicate files, but here's my tree (depth truncated selectively)
| jre
| lib
| -- com
| -- -- avocent
| -- -- -- avworks
| -- -- -- lib
| -- -- -- protocols
| -- -- -- video
| -- -- -- vm
| -- -- linuxnet
| -- -- -- jpcsc
| -- acvvWin32Lib.dll
| -- avctVideo.jar
| -- avctVM.jar
| -- avctWin32Lib.jar
| -- avmWin32Lib.dll
| -- avmWin32Lib.jar
| -- jpcsc.dll
| avctVideo.jar
| launch.bat
You can customize with variables to your desire, but here's the launch command I got to work on Windows 10 with JRE 1.7.0 x64:
START /B "" .\jre\bin\java.exe -cp avctVideo.jar -Djava.library.path=.\lib com.avocent.video.Nautilus title="DEVICE_NAME" devicetype=avsp path=a:KVM_IP,r:DONGLE_ID,c:0,e:1,s:"DEVICE_NAME",l:120 oem=DELL user=USER_NAME password=PASSWORD "helpurl=https://KVM_IP:443/help/contents.html"
where:
DEVICE_NAME
= the name of the device connected to the KVM port
KVM_IP
= the KVM IP
DONGLE_ID
= the ID of the KVM dongle (like 652432-13BB80
from the Web UI)
USER_NAME
= the KVM username
PASSWORD
= the KVM password
Virtual media is not current working, but everything else seems to be. I extracted the .jar files from
https://KVM_IP/viewers/avctWin32Lib.jar
etc... When available, I used the Win64
versions if they existed in the /viewers/
directory. I extracted the .jar files and put the contents into the root lib
folder along with any com
folders and merged.
I got this to work on Windows by doing the following:
-
Download jre-8u201-windows-i586.tar.gz (the last JRE before the new license)
sha256: dc419a2ebd838e2f3d4e0a0efb02024abad464129d5d8decb8a7b6fbde552227
md5: a44e40bb1f0f98a34fe13226b5f050eb
sha1: cef8b9979a872e908c43f9a1d81b9a859dbcece7 -
Open jre-8u201-windows-i586.tar.gz in 7-zip, and then inside it also open the jre-8u201-windows-i586.tar file (still within 7-zip), then open the jre1.8.0_201 folder, and then extract the contents to just .\jre\
-
Edit .\jre\lib\security\java.security in Notepad as follows:
For the line: jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, \ remove only the RC4, bit -
Download https://192.168.0.120:443/software/avctKVM.jar with web browser and put into root folder
-
Download https://192.168.0.120:443/software/avctKVMIOWin32.jar with web browser and put into .\lib\ folder
-
Download https://192.168.0.120:443/software/avctVMWin32.jar with web browser and put into .\lib\ folder
-
For both avctKVMIOWin32.jar and avctVMWin32.jar open in 7-zip and extract the containing .dll files into the .\lib\ folder
This should work for a long time to come. But there will be more fun when the SSL Cert expires in 2024.
Here is my batch file for windows 10 (64-bit, but easily changed for 32-bit)... it automatically downloads the jar files and unzips the .dll files if they don't exist so it can use the native dll libraries:
Also, keep in mind if you still have to update the java settings to allow the older TLS to work:
Java location .\jre\lib\security\java.security
Remove SSLv3 and 3DES_EDE_CBC from jdk.tls.disabledAlgorithms, should end up like so:
jdk.tls.disabledAlgorithms=RC4, MD5withRSA, DH keySize < 1024,
EC keySize < 224, DES40_CBC, RC4_40
@echo off
set /P drachost="Host: "
set /p dracuser="Username: "
set "psCommand=powershell -Command "$pword = read-host 'Enter Password' -AsSecureString ; ^
$BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^
[System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)""
for /f "usebackq delims=" %%p in (`%psCommand%`) do set dracpwd=%%p
IF NOT EXIST "avctKVM.jar" (
ECHO Grabbing avctKVM.jar from host...
powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctKVM.jar','.\avctKVM.jar')"
)
IF NOT EXIST "lib" (
ECHO Creating lib directory
mkdir "lib"
)
IF NOT EXIST ".\lib\avmWinLib.dll" (
IF NOT EXIST ".\lib\avctVMWin64.zip" (
IF NOT EXIST ".\lib\avctVMWin64.jar" (
ECHO Grabbing avctKVMWin64.jar from host...
powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctVMWin64.jar','.\lib\avctVMWin64.jar')"
)
ECHO Renaming avctVMWin64.jar to avctVMWin64.zip
rename ".\lib\avctVMWin64.jar" avctVMWin64.zip
)
ECHO Unzipping avctKVMWin64.zip
powershell Expand-Archive ".\lib\avctVMWin64.zip" -DestinationPath ".\lib"
rmdir ".\lib\META-INF" /s /q
erase ".\lib\avctVMWin64.zip" /q
)
IF NOT EXIST ".\lib\avctKVMIO.dll" (
IF NOT EXIST ".\lib\avctKVMIOWin64.zip" (
IF NOT EXIST ".\lib\avctKVMIOWin64.jar" (
ECHO Grabbing avctKVMIOWin64.jar from host...
powershell -Command "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} ; $WebClient = New-Object System.Net.WebClient ; $WebClient.DownloadFile('https://%drachost%/software/avctKVMIOWin64.jar','.\lib\avctKVMIOWin64.jar')"
)
ECHO Renaming avctKVMIOWin64.jar to avctKVMIOWin64.zip
rename ".\lib\avctKVMIOWin64.jar" avctKVMIOWin64.zip
)
ECHO Unzipping avctKVMIOWin64.zip
powershell Expand-Archive ".\lib\avctKVMIOWin64.zip" -DestinationPath ".\lib"
rmdir ".\lib\META-INF" /s /q
erase ".\lib\avctKVMIOWin64.zip" /q
)
java -cp avctKVM.jar -Djava.library.path=.\lib com.avocent.idrac.kvm.Main ip=%drachost% kmport=5900 vport=5900 user=%dracuser% passwd=%dracpwd% apcp=1 version=2 vmprivilege=true "helpurl=https://%drachost%:443/help/contents.html"
@mermao1 @codigobinario
See my above post if you are still having issues with the .dll files if you're running 64-bit windows 10 it automatically pulls all files for you and checks if they exist first so it doesn't pull them every time.
Hi @ready4droid
I'm trying to get on a iDRAC 6 from a Windows Server 2012 R2 Treminal Server
I can't use your script as there is no WinZip.
Attached are 2 screenshots of your script and the unable to connect message we get when just selecting JavaWS to open the downloaded file.
Any help or support would be greatly appreciated.
Hi @ready4droid
I'm trying to get on a iDRAC 6 from a Windows Server 2012 R2 Treminal Server
I can't use your script as there is no WinZip.
Attached are 2 screenshots of your script and the unable to connect message we get when just selecting JavaWS to open the downloaded file.
Any help or support would be greatly appreciated.
Apologies, I updated my post. This is using the inbuilt unzip from Windows 10 (possibly server 2016?). I can look into 2012 to see if it has any unzip options and re-work the script for you, but if you check my post and edit the java algorithms (the iDRAC 6 uses an old TLS protocol that is disabled in newer versions of Java, which is why you are getting the connection failed). The .zip files failing is not the reason it's not connecting though, it's needing to modify/edit your java security settings to allow the TLS connection. Once you fix this, you can unzip the .zip files by hand and just make sure the .dll files are in the lib folder and it'll work 100% correctly (and as long as it finds the .dll files in the lib folder it won't try to download/unzip them again). Since there can be so many versions of java I did not have it try to modify the security settings automatically (as finding JAVA_HOME and parsing the file would require admin rights as well).
Ok, found this:
"Prior to Windows Server 2016 there wasn’t really an easy built-in way of compressing files into a .zip archive by command line without custom scripts or tools, until now."
"PowerShell 5.0 was recently released for Windows Server 2008, 2008 R2, 2012, and 2012 R2, so you can manually install it there as well to make use of Compress-Archive and Expand-Archive cmdlets. Note that the installation will require a system reboot."
https://www.rootusers.com/how-to-zipunzip-files-in-windows-with-powershell/
So it seems if you update powershell to a version > 5.0 the auto unzip should function properly from Server 2008 and up.
I'm not sure i have permission to install a newer version of power shell.
I've manually unzipped the files from the target iDRRAC and added them as in the screenshot, but still get unable to connect. To be honest, this is out of my experience and i'm not really sure what I'm doing. I also have the java.security file edited for version 6.
I'm not sure i have permission to install a newer version of power shell.
I've manually unzipped the files from the target iDRRAC and added them as in the screenshot, but still get unable to connect. To be honest, this is out of my experience and i'm not really sure what I'm doing. I also have the java.security file edited for version 6.
First, those files don't have to be in your jre\lib folder, just in a lib folder from wherever you are running the .bat file. So the layout should look like this (you can put in any folder, but this is how the structure should end up).
c:\idracscript\run.bat
c:\idracscript\avctKVM.jar
c:\idracscript\lib\avmWinLib.dll
c:\idracscript\lib\avctKVMIIinLib.dll
Second, if you're getting the connection failed, then it's a java issue someway. Either you need to add an exception for the site in the java configuration or something still isn't right in your security file. Also, I don't have server 2012 in order to do any testing so this is as much of a suggestion I can give. As long as you get the "Connection Failed" it is going to be an issue with java security. The .jar file will still run properly even without the .dll files, it will just use generic plugins that don't work as well for the IO and possibly be missing the ability to mount virtual CD's and stuff, but the connection itself should still establish.
Perfect, its working now, it was the file location that was stopping it!
Thank you for taking the time to respond and help.
Perfect, its working now, it was the file location that was stopping it!
Thank you for taking the time to respond and help.
Great to hear, glad you were able to get it working!
I got this to work on Windows by doing the following:
1. Download **jre-8u201-windows-i586.tar.gz** (the last JRE before the new license) sha256: dc419a2ebd838e2f3d4e0a0efb02024abad464129d5d8decb8a7b6fbde552227 md5: a44e40bb1f0f98a34fe13226b5f050eb sha1: cef8b9979a872e908c43f9a1d81b9a859dbcece7 2. Open jre-8u201-windows-i586.tar.gz in 7-zip, and then inside it also open the **jre-8u201-windows-i586.tar** file (still within 7-zip), then open the **jre1.8.0_201** folder, and then extract the contents to just **.\jre\** 3. Edit **.\jre\lib\security\java.security** in Notepad as follows: For the line: **jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, \** remove only the **RC4,** bit 4. Download **https://192.168.0.120:443/software/avctKVM.jar** with web browser and put into root folder 5. Download **https://192.168.0.120:443/software/avctKVMIOWin32.jar** with web browser and put into **.\lib\** folder 6. Download **https://192.168.0.120:443/software/avctVMWin32.jar** with web browser and put into **.\lib\** folder 7. For both **avctKVMIOWin32.jar** and **avctVMWin32.jar** open in 7-zip and extract the containing .dll files into the **.\lib\** folder
This should work for a long time to come. But there will be more fun when the SSL Cert expires in 2024.
This worked for me too in August 2020. Thanks so much everyone!
Worked perfectly for me with the ...Win64... files. Many Thanks to everyone!
Thank you for this! Works in Arch Linux using the jdk-7u79-linux-x64.tar.gz tarball from https://www.oracle.com/java/technologies/javase/javase7-archive-downloads.html#license-lightbox
Thank you very much! I made the mistake of editing the script and filling in the host IP and user, don't do that, just fill in when prompted :)