biebers1

[Linux] Setting Up a Debian VNC Server (via SSH tunnel)

I. Abstract
No doubt, configuring a web server won’t work without being in the know of basics about the terminal, vim or nano. Anyway many tasks can also be performed by administrating a server using a GUI. The problem is: only Windows 2003 or Windows 2008 come with a preinstalled remote desktop connection – and they are really much more expensive than Linux solutions. When using our beloved and most stable Linux distributionDebian, it mostly comes preinstalled with almost nothing.
The following article assumes, you have a server, which can be managed via ssh rather than by physically access. We will show you how to setup a GNOME desktop on that server and virtually connect to that desktop using an SSH tunnel.
In case you are running a client machine with:
  • Linux or Mac OS X, just keep on reading, all tools come onboard
  • MS Windows, please install Cygwin with the openSSH package first
    (Note: you may also use the Putty/Pageant combo instead, but this will require some different steps. The following article is straightened to using Cygwin, because we feel it’s got several client sided advantages in contrast to Putty)
II. Preparations
First of all: log into your server via SSH as root. Make sure openSSH has been updated, a serious security flaw has been discovered some days ago concerning Debian based Linux distros. Make also sure you have secured your SSH access. We really recommend public-, private-key crypto for ssh login.
III. Update and Upgrade your server with current packages
Being logged into your server as root, do the following:
  • server$ apt-get update
  • server$ apt-get upgrade
  • server$ apt-get dist-upgrade
to upgade your whole installation.
IV. Installing GNOME
After having done a dist-upgrade we are used to reboot the servers. This might not be necessary in all cases and might be a strange obsession from ancient MS Windows times, but we would recommend it to allow all scripts to become initialized anew.
After reboot login as root again and do the following:
  • server$ apt-get install gnome-desktop-environment
V. Install fonts for GNOME and VNC
Install some (required) fonts for the VNC server GNOME session:
  • server$ apt-get install xfonts-100dpi
  • server$ apt-get install xfonts-100dpi-transcoded
  • server$ apt-get install xfonts-75dpi
  • server$ apt-get install xfonts-75dpi-transcoded
  • server$ apt-get install xfonts-base
VI. Install VNC server
We prefer TightVNCServer, simply because it worked from the very beginning…
  • server$ apt-get install tightvncserver
    (installs TightVNCServer)
  • server$ tightvncserver :1
    (initialize the VNC server for the first time, it will copy some files to ~/.vnc folder and it will ask twice for a VNC password – we recommend to provide it for your own safety)
  • server$ tightvncserver -kill :1
    (stop VNC server – for further configuration purposes)
VII. Configure VNC server
In this example we’re gonna use nano, you can also use vimvi or whatever you think what editor fits your needs best:
  • server$ nano ~/.vnc/xstartup
We need to change the standard X-Windows interface, since we like to use GNOME.
Original xstartup file:
  • #!/bin/shxrdb $HOME/.Xresources
    xsetroot -solid grey
    x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    x-window-manager &
Change this to
  • #!/bin/shxrdb $HOME/.Xresources
    xsetroot -solid grey
    x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    # x-window-manager &

    gnome-session &
Save and exit nano (ctrl + x).
VIII. Setup an SSH tunnel for VNC connections
VNC connections are usually to be found on port 5901. Usually they are not encrypted on that port. That means you send the VNC password unencrypted thru the net to that port. Since this allows too many attacks, it is just too weak for a web server solution.
We don’t want to provide possible Zombies. So the solution is: we just setup an SSH tunnel as a wrapper for our VNC connection. Further information about SSH tunneling can be found here and here.
On your client machine do the following:
In case you changed the ssh port on your server (like we recommended in our article here), you need to specify your ssh port for the SSH tunneling aswell, like:
  • client$ ssh -f -N -L 5901:localhost:5901 [email protected] -p 8722
    (in this case we use port 8722 instead of the standard port 22)
IX. Connect to your server via VNC
Start tightvnc on your server:
  • server$ tightvncserver :1
In case you like to have a different screen resolution than 1024×768 you may start tightvnc with:
  • server$ tightvncserver -geometry 1280x1024 :1
On a Mac the VNC client is called Chicken of the VNC (Download here). On Windows you can use RealVNC (Download here). Both work quite similar and contain almost the same features.
Use the VNC client (like Chicken of the VNC) to connect to your SSH tunnel,
  • connect to localhost (or 127.0.0.1)
  • display 1, because of port 5901 (display 0 would be port 5900)
  • enter your VNC password
    (the password, that has been setup in step VI. Install VNC server)
  • hit connect and
  • you should see something like that (on vservers the performance may be kinda slow and GNOME’s GUI may take some time to initialize).
Congratulations, you’re done.
X. Stopping VNC session and SSH tunneling
You can simply quit the VNC session by just closing your VNC client. But the SSH tunnel from your client to your server will still be up until you stop it (means until you kill it). We may provide a simple script to do that when we finished cleaning it up. Right now it is kinda spaghetti code. Although this is not too comfy, you may live with a simple command until then:
  • client$ killall ssh
It simply kills every SSH process 🙂
XI. Final words
We hope you enjoyed our trip into the amazing VNC worlds on Debian and also hope you learned something. You could now setup a firewall like firestarter, which is GUI driven. We will publish some words about this in the early future.

Administer Ubuntu Server 12.04 using VNC

Once you’ve installed Ubuntu Server you will need a mechanism to be able to administer it. One way is to Install Putty. Putty gives you a “Command Line” interface and so you’ll need to learn a few Linux commands in order to be able to administer your server this way. Some people find this prospect rather too daunting and would rather use a graphical user interface (GUI) instead. As a result many people actually install Ubuntu Desktop instead of installing Ubuntu Server since the desktop version of Ubuntu has the GUI built in. There is a better way however, and that is to install VNC. VNC provides a “virtual desktop” so it is more lightweight than a full blown desktop installation.

NOTE: If you’re jumping into this guide here then it’s worth mentioning that this guide has been tested on Precise Pangolin 12.04LTS, Lucid Lynx 10.04LTS, Karmic Koala 9.10, 9.04 Jaunty, and 8.10 Intrepid. However, at the time of writing VNC is quite flaky on Precise Pangolin 12.04LTS (although it is getting better all the time) and so I don’t particularly recommend you attempt to install it on this version of Ubuntu. You might want to head over to the forums for the latest views on VNC on 12.04.
So to perform the installation of VNC you can either type the following commands from a Putty session or, if you’ve got a screen and keyboard attached to your server, then you can use the command line itself.
First off you need to type:
sudo apt-get update
You’ll be prompted for a password. This is the password you created when you installed Ubuntu. Ubuntu tends to prompt for a password each time you issue a “sudo” command.
TIP: If you’re going to be following this guide step by step using Putty then you can save yourself some typing by simply highlighting each command below, right-clicking on it and selecting Copy. Then toggle over to your Putty Session and right-click once more. The command you’ve just copied from here will be automatically pasted into your Putty Session.

Install the Gnome components

First off we need to install the Gnome components for our virtual desktop. So type the following command (or copy it!):
sudo apt-get install gnome-core
when prompted type Y and then press [Enter]. This will install the gnome desktop components.

Install a Virtual Desktop using VNC

Now we’ve installed the gnome components for the desktop we need to install VNC to be able to interact with it. So type:
sudo apt-get install vnc4server
when prompted type Y and press [Enter]. This will install VNC Server which is required for running the virtual desktop on the server. Next type:
vncserver
You’ll then be prompted to create and verify a new password. Once you’ve entered it you’ll see the following screen:
We now need to kill the session we just created and make a tweak to the startup script for VNCServer to make it work properly. If we don’t perform this step then all we will see is a grey cross-hatched screen with an “X” cursor and/or a grey screen with a Terminal Session, depending on the Ubuntu version. Not very useful!
You’re probably wondering why we just created a session and then killed it before we’d actually used it? Well, creating the session for the first time automatically generates the file we now need to edit.

So, type the following command to kill the session:

vncserver -kill :1
Now type the following command to open up the file we need to edit:
vim .vnc/xstartup
The modifications we need to make to this file depend on the version of Ubuntu we’re using so make sure you follow the correct section:

Ubuntu versions up to and including 9.10 Karmic Koala

Scroll down to the line which currently reads #unset SESSION_MANAGER and press the [Insert] key once (this will switch us into “edit” mode) and then remove the #
Do the same for the line after that. Plus change that line to read as follows:
exec sh /etc/X11/xinit/xinitrc
Note the “sh“.
Change the xterm -geometry line as below and once you’ve made these changes the file should look like this:
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec sh /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 1280×1024+10+10 -ls -title “$VNCDESKTOP Desktop” &
twm &

Ubuntu Versions 10.04 Lucid Lynx & Maverick Meerkat 10.10

Change the file as above but note the last two lines are different in these versions of Ubuntu:
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec sh /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 1280×1024+10+10 -ls -title “$VNCDESKTOP Desktop” &
x-window-manager &

Ubuntu Version Precise Pangolin 12.04LTS

Change the file so it looks like this:
#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
gnome-session –session=gnome-classic &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
#x-terminal-emulator -geometry 1280×1024+10+10 -ls -title “$VNCDESKTOP Desktop” &
#x-window-manager &

So, we’ve unmasked the unset SESSION_MANAGER line, added the gnome-session –session=gnome-classic & lineand masked the last two lines out.

All Versions

When you’re done editing the file for your particular version of Ubuntu press the [Esc] key once and type the following:
:wq
This should save the changes and bring you back to the command line. If you make a mistake editing the file then issue :q! instead of :wq to abort your changes.
Next type the following command to create the VNC Session once more:
vncserver -geometry 1280×1024
where 1280×1024 is the resolution of your DESKTOP COMPUTER. It has nothing to do with the resolution of the server itself. This command will create a new VNC session on your server. Note: For versions of Ubuntu prior to Precise Pangolin 12.04LTS add a -depth 24 argument so the command should read vncserver -geometry 1280×1024 -depth 24
Next, download and install TightVNC onto your desktop computer. When you launch it type the “X Desktop name” in the VNCServer box. See the DOS-type screenshot above for the name of your “X Desktop name”. So, in my case I’d typeMyMediaServer:1 in the VNC Server Listbox. See below.
then click Connect, enter the password you created when you typed the vncserver command the first time round and you should then see a screen like this (Note that on Precise Pangolin 12.04LTS the screen is blue and that error message doesn’t appear):
Click the Delete button on the error message which is displayed and you now have a nice shiny desktop view onto your server!
Incase you’re wondering how what we’ve just installed differs to simply installing the full blown Desktop version of Ubuntu then connect a screen to your server now and you’ll see it’s still sitting there on a black screen with a flashing cursor waiting for you to type your username in. What we’ve just installed is just a “virtual desktop” onto your server. Neat eh!
Currently this “virtual desktop” runs in a window on your Windows desktop. If you want to switch to “Full Screen” mode, right-click on the TightVNC icon on the taskbar on your windows desktop and select Full screen from the menu. ClickOK on the next message. Now it’s as tho you’re actually sitting in front of your server. Very cool!
To switch out of Full Screen mode and return to Window mode press Ctrl-Esc on your keyboard to bring back your Windows Desktop taskbar. Then right-click on the TightVNC icon on the taskbar and uncheck the Full Screen option.
I know a lot of people wouldn’t bother installing a virtual desktop on their servers (and I’ve no doubt any Linux veterans reading this will be scoffing that I’ve done so) but I was a total Linux newbie when I started this project and the thought of administering everything using the command line was simply too daunting a prospect. Even tho I now feel much more comfortable with Ubuntu I still find it really handy to just nip into the Ubuntu desktop and tweak something.
When you reboot the server you’ll discover that you are unable to re-launch the VNC session and you’ll receive a “Failed to connect to server” error message. This is because the vncserver -geometry 1280×1024 -depth 24 command we typed above is not persistent. To solve this we need to ensure that VNC is run on boot: How to run VNC on startup

The Synaptic Package Manager is not installed by default in Lucid or Karmic

At the time of writing the Synaptic Package Manager does not get installed by default in Lucid or Karmic when you install the core gnome desktop. The Synaptic Package Manager is a great tool which makes adding and removing applications a breeze. So we’ll simply install it manually by typing the following two commands in a Terminal/Putty session:
sudo apt-get update
sudo apt-get install synaptic
When you now go into your server desktop via VNC you’ll find the Synaptic Package Manager under the System ->Administration menu.

How to prevent Gnome starting on the server on boot

On Ubuntu versions 10.10 (Maverick Meerkat), 11.04 (Natty Narwhal), 11.10 (Oneiric Ocelot) & 12.04 LTS (Precise Pangolin) gnome is automatically started on boot once the above instructions have been followed. So, if you connect a monitor to your server you will see the GUI sitting there waiting for you to log in. You can prevent this happening by carrying out the following tweak:
So, issue the following command to open up the relevant script:
sudo vim /etc/init/gdm.conf
You want to mask out the few lines which start the service ie. start on ((filesystem…. so the first few lines of the script should look like this once you’ve edited it:
# gdm – GNOME Display Manager
#
# The display manager service manages the X servers running on the
# system, providing login and auto-login services

description “GNOME Display Manager”
author “William Jon McCann <[email protected]>”

#start on ((filesystem
# and runlevel [!06]
# and started dbus
# and (drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
# or stopped udev-fallback-graphics))
# or runlevel PREVLEVEL=S)

stop on runlevel [016]

emits login-session-start

Save your changes then reboot the server and that log-in screen should no longer appear. 

Hard Reset Or 30/30/30 on a router

Image:Warning.png
DO NOT attempt to reset or power cycle the router while it is still in the process of upgrading!
Wait a couple of minutes after upgrade is complete and the router has rebooted itself.

Hard Reset (aka 30/30/30 reset):

The following procedure will clear out the NVRAM and set dd-wrt back to default values:
  • With the unit powered on, press and hold the reset button on back of unit for 30 seconds
  • Without releasing the reset button, unplug the unit and hold reset for another 30 seconds
  • Plug the unit back in STILL holding the reset button a final 30 seconds (please note that this step can put Asus devices into recovery mode…see note below!)
This procedure should be done BEFORE and AFTER every firmware upgrade/downgrade.
Do not use configuration restore if you change firmware builds (different svn build numbers).
[NOTE] – For Asus units, the standard 30/30/30 method will reset the router but you will need to use the Restore button followed by a Power cycle. The only exception (so far) is the RT-N16 model, follow the same method as stated above but use the WPS button instead of the Restore button. If all else fails to reset you can also do it by command line (all units). Login to the router via telnet/ssh and issue the command “erase nvram”. This will reset the nvram partition to defaults for this Make of router.….redhawk

Erasing NVRAM:

As an alternative method, it is possible to restore DD-WRT to default settings without using the reset button (useful if you’re locked out of the web interface or the reset button is disabled, broken, etc. or if your router just refuses to reset using 30/30/30).
[CAUTION] - On some devices, resetting NVRAM in this fashion may cause more problems than it solves. For example, Asus WL-500g and the Motorola WR850G bootloader will not recreate default values and will not boot properly after being reset. If you do this on a Siemens SE505 V1, your router will not be accessible to you anymore! You will have to reflash it with the stock firmware on IP address 192.168.1.1 (NOT 192.168.2.1 as the installation procedure says!!)
The following requires that DD-WRT already be installed on your router, and Telnet (or SSH) services be enabled and accessible.
Telnet (or SSH) into 192.168.1.1
Issue commands:
erase nvram
reboot
or
mtd -r erase nvram
The mtd method should be used with caution! The erase nvram;reboot method is much safer!
All should be in default settings now.


Default password

After resetting DD-WRT, you need to login with the user name “root” and password “admin”.

DD-WRT on Linksys E1000 v1 or v2

Linksys E1000

Please see this thread for information on E1000 and dd-wrt compatibility http://www.dd-wrt.com/phpBB2/viewtopic.php?t=79673


Install / Flash Linksys E1000 v1 only! (see above link for v2)

The following instructions are copied from Dark_Shadow’s forum post / wiki see: http://www.dd-wrt.com/phpBB2/viewtopic.php?t=79673 (same as link above). I am adding them here after testing and validating they work as per his request in the forum. They worked flawlessly for me installing on a Cisco Linksys E1000 v1 [–Apus.one 05:08, 15 October 2011 (CEST)].
  1. Read the Peacock Announcement.
  2. Download dd-wrt.v24-15279_NEWD-2_K2.6_mini_e1000.bin. If you wish to experiment with a newer build, you should read the “build thread” for any build you are considering putting on your router, before flashing a newer build, (as discussed in the peacock announcement).
  3. Set a static IP on your computer to 192.168.1.7. Subnet mask should be 255.255.255.0
  4. Connect the lan cable from your computer to a LAN port of your router. Make sure your router is plugged in. Nothing should be connected to your computer or the router except the lan cable between them.
  5. Ensure you have a physical ethernet connection to your router, and disable your wireless adapter, antivirus/firewall protection, and any software that makes strong use of your network (BitTorrent, Streaming Audio/Video, etc).
  6. Perform a hard 30/30/30 reset.
  7. Navigate to http://192.168.1.1/ in your web browser of choice.
  8. At the Linksys Administration > Firmware Upgrade page, do not give the reboot command. You will use this page to upgrade your firmware.
  9. Browse to the firmware you downloaded and click Upload.
  10. Do not touch anything. The page will tell you that the upgrade was successful and the router is now rebooting. Your router may take upwards of a couple minutes to reboot. Watch the lights… once the wireless and power indicators are on steadily for several seconds, your router is fully rebooted and you can click “Continue” in your browser window.
  11. If the DD-WRT password change page displays, your upgrade has been successful, and you must now perform another hard 30/30/30. This time, when you navigate to http://192.168.1.1/, click “Reboot” and wait for the router to come online again so you can configure it.
If the DD-WRT password change page does not display, your page request times out, or you can’t ping 192.168.1.1, make sure both wireless and power lights are on steadily first, then do a hard power cycle (unplug the power from the router–do not do a 30/30/30 reset). Wait a few seconds and plug the power back into the router. Wait until both wireless and power lights are on steadily, then navigate to http://192.168.1.1/ in your browser of choice again. If the DD-WRT password change page displays, your upgrade has been successful, and you must now perform another hard 30/30/30. This time, when you navigate to 192.168.1.1, click “Reboot” and wait for the router to come online again so you can configure it.
You can also flash the same firmware of TomatoUSB as described for WRT160N_v3.0


Performing a 30/30/30 Reset on a Linksys E1000 v1.0

  1. Perform a normal 30/30/30 reset.
  2. Login to http://192.168.1.1/ and you will see the Linksys – Management Mode page.
  3. Click “Reboot.”
  4. In a moment, you will see “Command reboot completed.” The router will now start the reboot process. When the lights return to their normal state, you can click “Continue” to be taken to the router’s main page.

Serial Recovery

I had an awfully difficult time doing serial recovery on this router. It was my first time so you can imagine that I had no idea what I was doing. There are some slight deviations from the standard serial recovery procedure that is in the Wiki so I decided it would be a good idea to add the information here. First of all, the pinout is the same as the E2000 (at least for the E1000 v2).
You should familiarize yourself with the Serial Recovery article before trying this, I’m not going to explain everything again here.
Here is the serial pinout. Image:E1000v2_serial.jpg
Looking from the back of the router you should see the 2×6 JTAG port and above that 5 holes. These 5 holes are the serial port. Again, looking from the back of the router: VCC – RX – TX – ? – Gnd
Once at the prompt you need to assign an IP/Subnet mask to eth0. I’m not sure if eth0 is the routers interface to the switch or one specific port but I had a CAT5 cable hooked up to port 1 on the router and it worked.
If you type “ifconfig eth0” you will see that there is no address assigned to the interface. The following command will assign an address/mask.
CFE> ifconfig eth0 addr=192.168.1.1 mask=255.255.255.0
Now you can flash using a TFTP client from your computer, which is plugged in to port 1 on the router, just like theSerial Recovery page says.

JTAG!

Barryware, using a mixture of perseverance and brilliance, has found a way to fix the fact that Linksys, in for completely baffling reasons, did not connect the jtag port to the processor. This isn’t for the faint of solder, but there IS now a way to jtag the 160nV3 and the E1000_V1! See this: http://www.dd-wrt.com/phpBB2/viewtopic.php?t=146077
flash -ctheader : flash1.trx

TF2 Idle Skip TF2 file validation in Steam Windows 7

When I first installed TF2 some time ago on a Windows 7 install, it exhibited this behaviour for me. The problem as it turns out was with my hard disk. By defragmenting my disk and my game, I managed to resolve the issue. You can try defragmenting the game files in Steam through the Local Files tab of Team Fortress 2’s Properties page in the Steam Library, but I found using the OS’s defragmentation tool was necessary if I recall. I’d recommend doing both just to be safe. You may need to validate files manually after this, but it should hopefully be the last time. At the time, there were no bad sectors reported and the hard drive was less than a year old, but fast-forward a year or two and that hard disk died on me so this may be an early indication of a problem with the hard disk that you may want to look into.

I used Auslogics Disk Defrag and highly reccomend it. It worked faster than the OS defrag option.

Fix InsightBB / Time Warner Slow Youtube Throttling

Summary, Drop these commands in your command prompt on windows Vista/7

netsh advfirewall firewall add rule name=”YoutubeHTTP1″ protocol=TCP localport=80 action=block dir=IN remoteip=173.194.55.0/24

netsh advfirewall firewall add rule name=”YoutubeHTTP2″ protocol=TCP localport=80 action=block dir=IN remoteip=206.111.0.0/16

Enjoy. The incredible thing is now I’m not even seeing any delay when switching to 1080p, I used to see a complete refresh and then a pause. Why do these commands create a better streaming experience? TimeWarner/Insight is throttling downloads from servers that host cached videos. By rejecting these IP address ranges you will force the video to be served to you directly. This harnesses the full download speed of your internet connection. Other people can dive into the complexity much better than I ever could, but that’s the overall theme.

Run a Command as Administrator from the Windows 7 / Vista Run box

If you are a command line junkie like me, and have been testing out Windows 7 or Vista… one of the first things you’ll notice is that there is no way to run a command from the run box in “Administrator” mode. Until now.
To try this out, go to the run box and type in something (cmd, for example)
Now instead of hitting the Enter key, use Ctrl+Shift + Enter. You will be prompted with the obnoxious User Account Control dialog… but it will then open up a command prompt in Administrator mode.
Hint: You can use Alt + C to quickly close the User Account Control dialog in Vista, or Alt+Y in Windows 7.

Complete guide to using TF2Idle

First of all, you will need:
Steam accounts to idle on. You can create new accounts here.
Sandboxie so you can run multiple Steam accounts. A full version is needed to run multiple sandboxes.
(optional) A Steam Dev API key for an account which contains a purchased game. This will be used to access steam backpacks so you can see your drops happening.

All my instructions are written assuming you will be running 8 idle accounts, and are running Windows 7. XP and earlier OSs do not have the mklink command available for making the symlinks needed to save a ton of hard drive space. I’ve also written it assuming you have Steam installed in c:Program Files (x86)Steam and you put all your idle steam copies in C:idle if you have these in different places, you will need to change the below info accordingly.

Preparations:

Firstly, you need Steam installed and TF2 downloaded and playable. If you’re idling then you no doubt already have an active account and play the game, so will already have this.
(I’m not sure if these parts are needed, but I saw that tf2idle checked for an idle.cfg so I did some googling and found this:)
Go to your steamappsusernameteam fortress 2tfcfg folder and create a new text file. Name it idle.cfg (Make sure it isn’t idle.cfg.txt turn on the showing of file extensions if you aren’t sure, google if you need to know how) and paste in the following:

fps_max 30
r_rootlod 2
r_lod 2
mat_picmip 2
threadpool_affinity 0
mat_aaquality 0
mat_bumpmap 0
mat_antialias 0
mat_reducefillrate 1
mat_specular 0
r_shadowrendertotexture 0
r_waterforceexpensive 0
mat_hdr_level 0
mat_hdr_enabled 0
mat_hdr_level 0
mat_hdr_manual_tonemap_rate 0
mat_aaquality 0
mat_use_compressed_hdr_textures 0
mat_disable_bloom 1
mat_bloomscale 0

Also, open up your server.cfg and add the following:

hostname "Valve Loves Idlers"
fps_max 30
rcon_password typeapasswordhere
sv_password typeapasswordhere
sv_minrate 13000
sv_maxrate 13000
sv_minupdaterate 20
sv_maxupdaterate 20
sv_mincmdrate 20
sv_maxcmdrate 20
sv_region 255
mp_waitingforplayers_cancel 1
mp_disable_respawn_times 1
mp_timelimit 9999
mp_allowspectators 1
mp_idledealmethod 0
mp_idlemaxtime 9999
sv_pure 2

*End of possibly unneeded stuff*

In your steamapps folder, create a new folder containing the username of each account you are going to idle with. Go into your original one, and copy the ‘team fortress 2’ folder, and paste it into each of these named folders. 

Create a folder to contain all the copies of steam needed for the sandboxes. For me, I simply made a folder in the root, c:idle
In this folder, create a new folder, and give it a simple name with a number at the end to help differentiate it. I named mine steam1 to steam8. Into the steam1 folder, copy the contents of your normal Steam folder, minus the steamapps folder, as that will be a huge folder. Once you have the steam1 folder, I simply copy+pasted it 7 more times into the folder, renaming each folder so I had 8 steam folders.
Each of these folders needs a symlink to your steamapps folder. This makes it appear that there is a copy of the steamapps folder in each of these steam installs, when in fact they are all automatically redirected to your base steam install. This means that you don’t need 8 copies of the ~10Gb of TF2 files for each sandbox.
Open up a command prompt (Not sure if you need admin rights, but run it as an admin just in case), and navigate to the first idle steam folder (c:idlesteam1 for me)
Once there type the following:
mklink /D steamapps “C:Program Files (x86)SteamSteamapps”

Now if you go to the steam1 folder, you will see what appears to be a shortcut to the steamapps folder, double click it and you go there, but the address bar still shows it as being in the steam1 folder, which is what we want.
You will need to repeat this for each idle steam folder you have, you can’t simply copy+paste the steamapps symlink. Use the command prompt to go to the steam2 folder, run the mklink again, and so on for all the idle accounts you want.

Now all that is prepared, you need to install Sandboxie, which is a program that will allow us to run multiple instances of Steam. Once installed, on the menu go Sandbox>Create new sandbox. Give it a name, don’t bother copying the settings.
Once created, right click it and go to Sandbox Settings.
In there, you need to go to the restrictions>Drop Rights option, and unsure it is unchecked
Next go to the Resource Access>File Access>Full Access, and add the root folder of the drive that contains Steam, and the drive which will contain all the sandbox files (If they are both on the same drive then you don’t need to add it twice)
Now, create more sandboxes, one for each account you will be idling with. With these, copy the settings from one of your previously made sandboxes so you don’t need to go into the settings for each one. Giving them all simple names is strongly advised.

Finally, run TF2Idle. I put it into c:idle so I had everything in the same place, but it doesn’t matter where it goes. Its a stand alone exe, no installing, though it does make its own cfg file, and will make error files to check if there are problems, so its nice to have it separated.
Hit the ‘add account’ button and it will bring up a simple screen. Your steam username and password are self explanatory. You will need to log into the Steam community page with each account to create a vanity ID, which is required for item tracking.
In the Sandbox Name, this needs to be the name of one of the sandboxes you created earlier in sandboxie. The sandbox path needs to be the root directory of one of the idle steam folders you created. For instance C:idleSteam1
You don’t need any of the other options, so just hit ok and your account will be listed there. Repeat this process for each account you want to idle with, remembering you need a different sandbox name and sandbox path for each account.

Once all the account settings have been made, in TF2Idle go file>settings
In the TF2 tab, the steam install location and sandboxie install location should have been filled automatically, but point it the right way if not. Enter the Steam API key obtained right at the top to allow you to track the drops into all of your accounts. The API key can be from any account, it just needs to have a game tied to it to be able to generate the key.
The backpack viewer is optionally used as a way to view details on an item that has dropped. Leave the idle launch settings how it is, and I would advise increasing the account launch delay to ~120 seconds, as this gives each account time to create a server and get through any CPU/ram intensive tasks before the next one tries. And you aren’t going to miss a couple of minutes not idling.
Any other settings are optional. In the TF2Idle tab you can select to encript the config file, as this otherwise contains the steam account usernames and passwords in plaintext.


And you’re done! For the first time running, I would select one account at a time (orange icon if selected, grey if not by default), and hit the ‘start idling’ button. This will launch steam through sandboxie, and you will eventually get a command prompt full of text as the game runs in text mode. For reference, mine looks like this. The important thing is that it contains the ‘<account name> connected’ line near the bottom, as this shows you have connected fine. Once it looks ok, unselect the first and select the second, and start idling again (You don’t need to close the first one). Repeat this for all of the accounts, until they are all idling. Once they started up ok, next time you can just select them all and hit the start idling button and it will do all this automatically, but for the first time I find it better to start them manually so you can spot any problems.

Once they are all idling you can hit the ‘terminate sandbox’ to obviously stop them idling.
Otherwise, you can hit the ‘drop log view’ to see the drops, though first you will need to click ‘add accounts’. This should bring up a message for each account confirming that it has started logging the drops. Then you can sit back and watch as the list slowly fills up with all your free items. 
And now you’re idling!

References:
This thread for the .cfg contents

Questions or comments? Ask here! Everything I’ve just posted comes from searching various forums and threads trying to work out how exactly to get this working, so I hope this proves useful to some of you. And in the end, all credit goes to Moussekateer for actually making TF2Idle in the first place!
And remember, free TF2 accounts can only find weapons, no hats. And you can’t trade either, you’ll need to buy a copy of TF2/buy something from the Mann Co store if you want to get the top drops and start shifting them over to your main account.

Here’s some pictures of my setup:
http://i.imgur.com/KFoqQ.jpg – Idle folder containing 8 physical copies of the steam folder, bar the steamapps folder.
http://i.imgur.com/hhFsj.jpg – Inside one of the steam folders, showing the mklink steamapps
http://i.imgur.com/LAmCw.jpg – Inside the steamapps folder, account names blanked out.
http://i.imgur.com/TZZIi.jpg – TF2 idle settings, API key blanked out
http://i.imgur.com/R6CrP.jpg – More TF2 idle settings, details blanked out
http://i.imgur.com/yYPUv.jpg – 8 named sandboxes
http://i.imgur.com/gtPBn.jpg – Sandboxie full access

How to Disable Easy Install in VMware Player 3.0

The VMware Player 3.0 Easy Install is pretty useful but in certain cases, we want it disabled. Inside VMware Player settings, there is not an option to disable Easy Install so here is a quick trick/tip to by pass:
  1. First start VMware Player
     
  2. Create A New Virtual Machine
     
  3. Select the option “I will install the operating system later”

     
  4. Once done, your new virtual machine will be added to your virtual library, under Home.

     
  5. Double click on your new Virtual Machine to start it.
     
  6. It will next say the OS is not installed and provide an option to insert the OS installation media.

     
  7. Simply click on Change CD/DVD Settings to select your media then Restart VM!
Hope you like it!

Multiplayer connectivity errors with Trine 2 Ping Keeps Increasing

I was trying to play trine 2 with my friend and ran into problems connecting to eachother. Sometimes we could connect and see the other person connect, displaying their name in the lobby, but their ping would skyrocket from 300-2000 ping, and on the other side the player connecting would just see a “connecting…” screen. Connection problems have been known for Trine2, many threads have been made on the steam forums.

The solution we figured out involved changing a value in a config file in %APPDATA%/Trine2 called options.txt.
In that cfg file there is an option; setOption(networkModule, “DisableSteamRelay”, false). It is set to false by default. Change it to ture so that; setOption(networkModule, “DisableSteamRelay”, true) is saved in the options.txt file. Make sure to close the game before you do this or it will change the value back. Both players need to change the option in their options.txt config file.

Another thing to check is if the ports for the game are correctly opened. We temporarly set our routers to DMZ mode, which is an option, but forwarding the ports is more secure. Frozenbyte makes a console program that checks to see if the correct ports are open for Trine 2. The program can be found at
http://www.trine2.com/help/Trine2_nettest.zip

It will run and display whether or not the correct ports are open for Trine2.

Another solution that was given in the forums by a developer of FrozenByte was as followed: .

Playing with v1.14

If you’re having connection issues, you can try the older v1.14 version of Trine 2. It uses different multiplayer methods internally. 

You should know that savegames from versions 1.15 and 1.16 are not compatible with 1.14 (it will simply not recognize them as having any levels completed). So be prepared to lose your savegames. You can avoid that by using a different save slot (Settings -> Save Slot) and not touch the other saves, but it may not always be bulletproof. 

You should do the downgrade to all co-op players, because 1.14 can only play with other 1.14 players. Mixing 1.14 and 1.16 will not work. 

To downgrade to 1.14: Launch Steam, go to Library, right-click on Trine 2 and go to Properties. Then go to Betas tab, and choose “old”. It doesn’t require password. Now Steam will load v1.14 on your computer. (“old_v115” is v1.15 but it is based on the new multiplayer system so you don’t want to use that.)

To summarize, this thread to help with the various multiplayer errors and troubles that still occur to some users. For general information, Trine 2 now supports multiplayer between Steam (Windows/Mac), and also with standalone Mac and Linux versions. This works very well for the most part and most players don’t encounter any problems – there’s a lot of multiplayer games going on.

That said, some are encountering errors and other trouble. Usually it’s related to connecting to other players. The game will output an error code when it can. This can happen due to a few reasons – one reason is the simple fact that the servers might be under heavy load right now. It’s advised to try a few times at least. If the error numbers are always different, then that might indicate that the problem isn’t “permanent” and you’ll get through with enough tries. 



Error codes

Here are the error codes and explanations:

0 = NetErrorUnknown
// Unexpected disconnection

2 = NetErrorJoinLobbyAborted
// User cancelled connection attempt

3 = ConnectFailReasonNotOnline
// Not connected to master server

4 = NetErrorNoResponseFromHost
// No reply received in 30s

6 = NetErrorConnectionRejected, NetErrorNoResponseFromServer
// Connection was lost

7 = NetErrorConnectionRejectedByServer, Disconnecting
// Server is disconnecting

8 = NetErrorConnectionLost
// Connection was lost

9 = NetErrorConnectionSyncDataTimeOut
// Sync data was not received in 30s (slow connection)

10 = NetErrorConnectingToMasterFailed
// Cannot connect to master server

65539 = ConnectFailReasonFull
// Game is full

65541 = NetErrorConnectionRejected, ResponseRejectedFull
// Game is full

65543 = NetErrorConnectionRejectedByServer, ServerFull
// Game is full

131075 = ConnectFailReasonRejected
// Rejected by peer

131077 = NetErrorConnectionRejected, ResponseRejectedBadPassword
// Invalid password

131079 = NetErrorConnectionRejectedByServer, BadVersion
// Incompatible version

196611 = ConnectFailReasonInvalidTarget
// No such peer

196613 = NetErrorConnectionRejected, ResponseRejected
// No longer hosting a game

196615 = NetErrorConnectionRejectedByServer, BadRequest
// Incompatible version

262147 = ConnectFailReasonTimeOut
// Connecting took too long

262151 = NetErrorConnectionRejectedByServer, TimeOut
// Join attempt timed out

327683 = ConnectFailReasonDeleted
// Disconnected from master server

393223 = NetErrorConnectionRejectedByServer, KickedOut
// Kicked out by server



Trine 2 nettest program

We have a quick port test program now at
http://www.trine2.com/help/Trine2_nettest.zip

This may help figuring out if the ports are open or not. It is not, however, conclusive – most players will be able to play just fine even if the ports are closed. (We’ll try to add some more help and how-to as we go along, but right now you’ll have to look elsewhere for info on how to open those.) 



How to start solving the problem

First, make sure the Steam Ports are open. 

Then, there’s a lot of different options that relate to multiplayer in the game itself. You can access them by opening %APPDATA%Trine2 folder and then opening options.txt. %APPDATA%Trine2 can be copypasted to Windows Explorer and it should go to e.g. C:UsersJoelAppDataRoamingTrine2 (AppData is a hidden folder). On Mac it’s in ~/Library/Trine2/

The settings we are looking for are at the end, and the most important ones are these:

setOption(networkModule, “AllowSteamConnections”, true)
setOption(networkModule, “AllowNonSteamConnections”, true)
setOption(networkModule, “AllowSteamRelay”, false)

The first thing to try is to enable AllowSteamRelay. If it doesn’t work, change something else and try again… 



Private/Public games

There’s been reports that Private games have more trouble than Public ones. So try Public and see if it has the same issues. We are looking into this too and will see if there’s anything that would cause this (there shouldn’t, but who knows)…



Private games with password

The password system in Trine 2 is a little unintuitive. Even if you are invited by your friend, you may get a Bad Password popup. In this case, go to the Multiplayer / Join Online Game menu, and join the Private game manually. First enter the password at the bottom of the screen, and then click on the server to join. 



Other things

If you have any internet speed/connectivity programs on the computer(s), e.g. to boost downloads, or other similar things, please make sure they are not enabled. 



Petrified Tree / The Final Chapter

We are aware of some strange disconnection issues with the levels Petrified Tree and The Final Chapter. These seem to be related to Low/Very Low graphics settings (which cause longer loading times as well). You may do well to try Medium settings and see if the problem remains with these levels. 



Playing with older version

One alternative, if you only want to play with Steam friends, is to try out the older version of the game. This may help in some of the cases (but not all – the newer version should be the best one for most people). 

If you are interested in that, there’s a couple of things to know:

1. Your savegames will get messed up. Newer versions of the game can load any savegame, but older versions do not recognize newer savegames. Therefore, if you “downgrade” to v1.14, your v1.16 savegames will not work (they may show up as only having the Story Begins level available). Use a different “Save Slot” for v1.14 and that way you might be able to keep all saves in working condition. In general, be prepared to lose your savegames. 
2. V1.14 can only play multiplayer against other v1.14 versions. So if you do this, you can only play with your friends or others who use the same version (which is very few people).
3. This has not been done many times so something strange can happen – most dramatic would be losing your savegames (as said in #1). 

If that sounds ok, then here’s instructions on how to do this: Launch Steam, go to Library, right-click on Trine 2 and go to Properties. Then go to Betas tab, and choose “old”. It doesn’t require password. Now Steam will load v1.14 on your computer. (“old_v115” is v1.15 but it is based on the new multiplayer system so you don’t want to use that.)



Enable multiplayer logging

In options.txt ( %APPDATA%Trine2 , see above for a longer explanation), there’s this line:

setOption(networkModule, “NetLogEnabled”, false)

set it to true, and the game will produce a log of the events to logtrine2.log file. You can open this file with e.g. Notepad, it’s just text data. Please either copypaste it along with your post or make it available elsewhere online, so we can take a look at it. 



Report your problem in detail

To help us figure out what’s going on. 

Here’s some information that would help:

– the net log output ( trine2.log )
– what game settings you are using (resolution, graphics detail level, etc)
– your computer specs
– your location (country/city)
– your ISP and bandwidth/connection


http://forums.steampowered.com/forums/showthread.php?t=2827833