Wednesday, February 8, 2012

Reducing the Size of the Roaming Profile

I have a roaming profile for Windows that can be accessed from any computer on the intranet. When the profile is too large, it takes a long time to log in and out, since so much data has to be downloaded and uploaded.

Two apps that affect the size of the profile are NetBeans and Thunderbird. By default, the user files are placed in the profile. A third app is DropBox. That is a real killer.

NetBeans

First, close NetBeans.

To move the user files for NetBeans, navigate to the install dir for NetBeans and modify
/etc/netbeans.conf

Look for
netbeans_default_userdir=.....

Change it to the new location. Use ${varname} to include environment variables.

If an environment variable is used, this will change the location of the file for all new configurations.

Thunderbird

First, close Thunderbird.

To move the user file for Thunderbird, modify the profiles.ini in the AppData folder.
In Windows, type %appdata% from the run... option in the Start menu to open the AppData folder.

Change to the Thunderbird folder. The profiles.ini file is here. Edit it and change two things:
IsRelative=0
Path=C:\........

Move the default profile folder that is in the Profiles folder to the new location.

This only moves a profile that already exists. I do not know how to change the initial location of the profile.

Dropbox

From the Dropbox preferences, select a new location for the Dropbox files. Caution: The Dropbox folder cannot be placed on a network share. Dropbox can not tell the difference between "The share folder is not available" and "The user just deleted all the files in the share".





Check out my other blog post on moving Dropbox out of the roaming profile.

Saturday, February 4, 2012

Connecting X11 without ssh

I have a situation where ssh -X is too limiting for what I need to do.

I have the ability to sudo to any user account on a remote Linux machine.
I am not able to log in as root.

ssh -X works perfectly for connecting as me to the remote machine. I am able to open X windows programs. Once I change to another user, I am unable to execute X windows programs.

I found a solution after reading several helpful posts:
http://hints.macworld.com/article.php?story=20081208062918906
http://dragonwall.net/xdeep-putty.html

I enable X11 listening on my Mac.
defaults write org.x.X11 nolisten_tcp 0
If xwin is running, stop it and restart it.

At first, I opened port 6000 to allow access to the display. After reading the comments about opening port 6000 through the firewall, I realized I needed to connect via the VPN to the remote computer.
http://www.publicvpn.com/support/MacOSX105.php

I connected to my VPN. The link above did not use PPP, so I had to make that modification to the steps. I was able to connect.

I am using a Mac, so I could open a terminal. The prompt at the terminal window indicated that I was connected to the VPN. I issued ifconfig to get the local ip address from the VPN.

I issued ssh to connect to the remote computer. I did not use -X, since tunneling will not work when I change to another user.

At the remote command prompt, I set the display environment variable to the ip address of the local VPN address, adding :0 to the end.
setenv DISPLAY xxx.xxx.xxx.xxx:0

I tested opening an xterm as me. It worked.

I changed to a different user and opened an xterm. It worked.

I checked that the firewall was still blocking port 6000. The port is only accessible through the VPN.

After all this, opening the application that I need takes too much time. It will be faster to drive to the remote location and log into the machine to do the work I need to do.

I will disable X11 listening on my Mac.
defaults write org.x.X11 nolisten_tcp 1



Next attempt.

I have the MS Office suite on my Mac. It has Remote Desktop Connection. I can use it to log into the remote computer.

The remote computer is Windows 7, but it has cygwin installed on it. I followed these steps:
  1. Connect to VPN.
  2. Remote Desktop to remote Windows 7 computer (local.name).
  3. Open cygwin bash shell.
  4. Issue startxwin command in /usr/bin
  5. Open xterm
  6. Enabled xhost connections for remote Linux host (remote.name): xhost +remote.name
  7. ssh without X11 tunneling to remote Linux host.
  8. Set DISPLAY to local.name:0
  9. Change to different user and open xwin application.
  10. The GUI app opened immediately.

Followers