Export remote X to local dedicated virtual terminal (VT)

I know I saw it some where on here before but I can’t seem to find it again. And yes, I’ve googled it.

I have a “remote” server and I want to have it’s X exported to my “local” laptop. Preferably, it gets done automatically from boot. I know that virtual terminals 1-6 are all text terminals and 7 is the local X. How can I get my laptop to automatically create a virtual terminal on 12 that’s dedicated to receiving the X display from the server?

I know how to get it over SSH/putty. And also how to stop the local and restart the X client on 7 to use the remote. But one of the beauties of Linux is the automation and multi-user environment. It’s essentially going to act as a KVM with gui replacement over IP.

You would have to run an additional X server displaying on vt12 and run xdcmp on the remote server (which isn’t really secure, but ok on your own LAN). Otherwise a tunnelled X over ssh should do it for really remote servers. It’s a bit like setting up a thin client so that might help.

I once wrote a upstart script to start an xdcmp chooser on vt8 on an Ubuntu laptop automatically. It really isn’t suitable for you, but might give you some ideas.

description     "Remote X login"
author          "Ken Yap"

start on gdm-started and net-device-up IFACE=eth0
stop on runlevel [016]

    if  -r /etc/default/locale ]; then
        . /etc/default/locale
        export LANG LANGUAGE
    elif  -r /etc/environment ]; then
        . /etc/environment
        export LANG LANGUAGE
    exec X :1 -audit 0 -auth /var/lib/gdm/:1.Xauth -terminate -query myserver vt8
end script