From within Windows, make sure you have all of the following software installed:
Once you have everything installed, open up Xming. Then open up PuTTY.
PuTTY will display a PuTTY Configuration window.
A terminal window will open and you can log in as root. Enter all of the following commands:
$ apt-get update $ apt-get upgrade $ apt-get install znc xvfb screen wineNext, grab the xauth key by typing:
$ xauth list $DISPLAY(it should return something that looks like mirc/mirc:10 MIT-MAGIC-COOKIE-1 c3058034135 ... .. copy or write down this entire string as you will need to use it later.)
Next, set up ZNC so mIRC can have a persistent connection to the destination IRC server in case mIRC has to restart for any reason. Type the following:
$ adduser znc(Create a password when prompted, then hit enter for all of the secondary values until Y/n then hit y then enter)
$ adduser mirc(same as before)
$ su znc $ cd ~ $ znc --makeconf(you will be prompted several questions. use this table to guide you through the questions)
Now switch to the user 'mirc' by typing:
$ su mirc(enter the password for 'mirc' that you typed in earlier via adduser mirc) .
Grab the long string you copied earlier (e.g. mirc/mirc:10 MIT-MAGIC-COOKIE-1 c305 ... ) and type:
$ xauth add mirc/mirc:10 MIT-MAGIC-COOKIE-1 c305 ...(replace the contents after xauth add with the string you saved.)
Next, type:
$ cd ~ $ script /dev/null $ screen -S mirc $ wget --trust-server-names http://www.mirc.com/get.phpThis will download the mIRC setup file. It will be something like mirc743.exe. Type ls to see the exact name of the file. Now, type:
$ wine mirc743.exe(or whatever the filename is. you could type wine m then hit tab then hit enter, as well.)
If everything is setup correctly (e.g. you are running Xming on your Windows machine, and PuTTY is properly configured, and you added the MIT MAGIC COOKIE string to xauth) Wine will open. It may ask you to download a new Mono file. You can click Yes to download. Once it finishes installing, be patient and wait a minute. The mIRC installation will automatically start.
Once the mIRC setup begins, it will guide you through several installation screens. The following bullet points will guide you through each screen.
Next, type:
$ cd .wine/drive_c/Program\ Files/mIRC/ $ Xvfb :1 -screen 0 640x480x16 -ac -nolisten tcp & $ export DISPLAY=:10 $ wine mirc.exe(please be very patient. mIRC will load for the first time and depending on your system/internet connection.. Xming might render this very slowly.)
Remember, mIRC requires you to purchase a license. It is also required to hide the startup nag screen. You should ideally have this information on hand so you can enter in the information now.
Click the 'here' hyperlink where it asks if you have a registration code to enter it here.
After enterting your registration code it will bring you back to that start splash screen. Uncheck 'Show on startup' and then click Continue.
Next, you are going to need to perform several steps to optimize mIRC so that it can run on the server without interruption. After a second or two, mIRC will open a popup 'mIRC Options' window on load. This section of this guide is located on a seperate page with screenshots to guide you through this process. Please click here to go to this section.
Now that you have set up your mIRC options, you need to configure mIRC to connect to ZNC on startup.
To ensure that you are the only user who has authorized access to this instance of mIRC, you will want to provide some sort of authentication mechanism script. This guide provides a very simple password-based authentication script, but this is by no means the only solution. Other things to try might be to create a Time-based One-time Password (TOTP) scheme, if you are really adventerous.
To use a basic password-based authentication mechanism, type this into the input field in the mIRC window:
In the menu bar at the top of the mIRC window, click Tools > Scripts Editor. (or press Alt-R to open the Scripts Editor)
Paste the following script into the window:
//echo $sha256(yourpasswordgoeshere)
(where 'yourpasswordgoeshere' is obviously some sort of complex password that only you know). Make a note of this string as you will need to use it in a second.
;
; connect to ZNC on start
;
on *:START: {
/server 127.0.0.1:7899 USERNAME/NETWORK:ZNCPASSWORD
}
;
; pm MYNICK youre online
;
on *:CONNECT: {
.msg MYNICK i just restarted..
}
;
; bare-bones remote control
; if $1 = password, execute $2-
;
on *:TEXT:*:?: {
if ( $sha256($1) = SHA256STRING ) && ( $nick = MYNICK ) && ($2) {
$2-
}
}
Edit the following values as needed..
USERNAME | the username you specified earlier when setting up a user for ZNC (e.g. 'mirc') |
NETWORK | the network name you specified earlier when setting up a network for ZNC |
ZNCPASSWORD | the password you specified earlier for this ZNC user |
SHA256STRING | the string you generated a second ago when you typed //echo $sha256 ... |
MYNICK | the IRC name you primarily use on your local computer at home |
Close mIRC by clicking the X in the top right corner.
mIRC will close and return you to the command line. Open mIRC up again to confirm everything is working fine by typing:
$ wine mirc.exemIRC will re-open and automatically connect to the IRC network. It should also have send you a PM on your home computer saying 'i just restarted' (if you are currently locally signed onto the same network).
a 'mIRC Favorites' popup window will have opened.. uncheck 'Pop up favorites on connect' and click OK.
Close mIRC again by clicking the X in the top right corner. When you return to the command line, type:
$ export DISPLAY=:1 $ wine mirc.exewait a few moments and then press Ctrl+A then Ctrl+D to detatch the mIRC screen. mIRC will now be running in a headless screen session (kept alive by xvfb).
Now, open mIRC on your local computer. Log onto the same network that your remote mIRC client is connected.. by typing (in mIRC):
/server irc.jollo.org:+9999Confirm that your remote mIRC client is active and at your control by typing:
/msg mirc yourpasswordgoeshere /join #testroom /join #testroom..where mirc is the name of your remote mirc client irc nick.. and yourpasswordgoeshere is the secret password you created earlier when setting up the script on the remote mIRC client. Note: yourpasswordgoeshere should be the actual password you created and NOT the $SHA1 string output.
If all went well, you should see your remote mIRC client named 'mirc' in the room #testroom.
It is now only up to your imagination to control the remote mIRC session locally. You should theoretically never have to shut down and open mIRC back up via ZNC as it is completely remote-controllable through commands (including restarting the client via /exit -nr). You could even create a script that automatically uploads or updates scripts on the remote server directly from IRC.
If you want to upload/remote/edit files on the remote server via SFTP, for example,.. the path to the mIRC directory is:
/home/mirc/.wine/drive_c/users/mirc/Application Data/mIRCscripts for example can be uploaded to
/home/mirc/.wine/drive_c/users/mirc/Application Data/mIRC/scriptsand once a script is uploaded into that folder it can be activated in the remote mIRC client by messaging the client:
/msg mirc yourpasswordgoeshere /load -rs scripts/file_you_just_uploaded.mrc
identifier | possible discrepancy |
$wrap | line-wrapping might not work correctly if you do not have the correct font installed on Linux that you have installed on Windows. I've had good luck with consistency using the font Courier locally and remotely. |
$ctime | if your script makes use of UNIX time.. take caution that your remote server might not be perfectly synchronized to a universal clock. In my testing, my remote server was around 14 seconds off and was causing problems in one of my scripts that depended on universal time. |
$dll | i cannot vouch for use of dll's running under WINE |