Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Linux Timesaving Techniques For Dummies.pdf
Скачиваний:
59
Добавлен:
15.03.2015
Размер:
15.98 Mб
Скачать

Creating New VNC Desktops on Demand 245

Creating New VNC Desktops on Demand

In the “Serving Up a New Desktop with VNC Server” section, earlier in this technique, we show you how to manually set up a VNC server. That works well for a quick-and-dirty solution, but to really save time, you can configure the GNOME Display Manager (gdm) to create new desktops on demand. Fedora Linux uses gdm to manage graphical desktops even if you’re running KDE. SuSE and Mandrake Linux assume that you want to use the KDE display manager. The technique we describe here works only if you’re using the GNOME display manager, so we also show you how to switch from the KDE display manager to gdm. When you hook up gdm and the VNC server, a new desktop is created each time you log in with a VNC viewer. Now that’s a timesaver!

One really great thing about the gdm/VNC combination — lots of users can log in to the same machine and each one gets his own individual desktop. This is a great way to make Linux converts out of your stalwart Windows users.

Switching display managers in SuSE Linux

To switch your SuSE Linux system from kdm (KDE display manager) to gdm (GNOME display manager), follow this procedure:

1. Open the main menu and choose System YaST.

2. If prompted, enter the superuser password and click OK.

3. When the YaST control center appears, choose System, and then choose Editor for /etc/sysconfig Files.

4. When the System Configuration Editor appears, open the Desktop section of the tree control (in the left-hand pane).

5. Open the Display manager section of the tree control and click DISPLAYMANAGER.

Your System Configuration Editor window should look like Figure 35-3.

Figure 35-3: The System Configuration Editor.

6.Open the drop-down list labeled Setting of: DISPLAYMANAGER and choose gdm.

7.Click Finish to close the System Configuration Editor, and then close YaST.

8.Reboot your computer.

When your computer reboots, it runs the GNOME display manager.

Switching display managers in Mandrake Linux

The Mandrake Control Center makes it very easy to switch display managers — just follow these steps:

1. Open the main menu and choose System Configuration Configure your computer.

2. If prompted, enter the superuser password and click OK.

3. When the Mandrake Control Center appears, click System, and then click Display Manager.

4. Click GDM (GNOME Display Manager), and

then click OK.

At this point, the Display Manager editor asks if you want to restart the dm (display manager) service. Before you click Yes, be sure to close

246 Technique 35: Using VNC to Connect to Remote Desktops

any other applications that you have open on your desktop: When you click Yes, your graphical environment will shutdown and then restart using gdm.

5. After closing all other applications, click Yes to restart the display manager.

Connecting gdm and VNC

To connect gdm and VNC:

1. Open a terminal window and give yourself superuser privileges:

$ su Password:

#

2. Start your favorite editor and enter the text shown in Listing 35-1.

You can adjust the “-geometry 1024x768” part if you want a larger or smaller desktop.

3. Save your work in a file named

/etc/xinetd.d/vncserver.

4. Open /etc/services and add the following line to the end of the file:

vnc 5900/tcp # VNC Server screen :0

That defines a TCP protocol named vnc (on port 5900). Whenever xinetd detects a connection attempt on port 5900, it consults /etc/ xinetd.d/vncserver to figure out which program to run.

5. Save your work and close the editor.

6. Run the gdm configuration program.

# gdmsetup

This opens the Login Screen Setup dialog, shown in Figure 35-4.

7. Choose the XDMCP tab, check Enable XDMCP, and then click Close.

8. At the command line, tickle the gdm daemon to make it re-read its configuration file:

kill –SIGHUP $(cat /var/run/gdm.pid)

Figure 35-4: The Login Screen Setup dialog.

9. Finally, tell xinetd to re-read its configuration files:

kill –SIGHUP $(cat /var/run/xinetd.pid)

Now you’re ready to create new desktops when you need them. When another user wants to connect to your computer (or if you want a new desktop because you’re sitting at a different workstation), just log in with a VNC viewer. gdm and VNC will be listening for connections to display 0 (if your computer’s name is brussels, you want to connect to brussels:0). When a connection request comes in, VNC creates a new desktop, and you’re ready to log in.

LISTING 35-1: /etc/xinetd.d/vncserver

service vnc

 

{

 

disable

= no

socket_type

= stream

protocol

= tcp

wait

= no

user

= nobody

server

= /usr/bin/Xvnc

server_args

= -inetd -query

localhost –once securitytypes=none

-geometry 1024x768 -depth 24

log_on_failure

+= USERID

}

 

Соседние файлы в предмете Операционные системы