<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>FalconIA&#039;s BLOG &#187; vnc</title>
	<atom:link href="https://falconia.org/blog/archives/tag/vnc/feed" rel="self" type="application/rss+xml" />
	<link>https://falconia.org/blog</link>
	<description>FalconIA&#039;s Lazy Blog</description>
	<lastBuildDate>Tue, 02 Dec 2014 01:45:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>[Quoted] VNC from boot on Ubuntu 12.04 without logging in, using LightDM and x11vnc</title>
		<link>https://falconia.org/blog/archives/435</link>
		<comments>https://falconia.org/blog/archives/435#comments</comments>
		<pubDate>Sat, 02 Mar 2013 07:26:37 +0000</pubDate>
		<dc:creator><![CDATA[FalconIA]]></dc:creator>
				<category><![CDATA[系统相关]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vnc]]></category>

		<guid isPermaLink="false">http://falconia.org/blog/?p=435</guid>
		<description><![CDATA[Quoted: http://seb.so/vnc-from-boot-without-logging-in-ubuntu-lubuntu-xubuntu-and-mint-lmde/ Instructions LightDM apparently supports a VNC server out of the box; however, it’s designed to work with tightvncserver (or similar) which create separate X sessions (the 2nd lot of VNC servers I mentioned above) so not quite what we’re after1. Ubuntu derivatives use Upstart (upstart.ubuntu.com) to manage startup processes - LightDM (and GDM!) [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>Quoted:</strong> <a href="http://seb.so/vnc-from-boot-without-logging-in-ubuntu-lubuntu-xubuntu-and-mint-lmde/">http://seb.so/vnc-from-boot-without-logging-in-ubuntu-lubuntu-xubuntu-and-mint-lmde/</a></p>
<h2>Instructions</h2>
<p>LightDM apparently supports a VNC server out of the box; however, it’s designed to work with tightvncserver (or similar) which create separate X sessions (the 2nd lot of VNC servers I mentioned above) so not quite what we’re after1.<br />
Ubuntu derivatives use Upstart (upstart.ubuntu.com) to manage startup processes - LightDM (and GDM!) creates a login-session-start event when the display manager is up (i.e. when X is all loaded, but before you’ve logged in) so we’ll create an upstart job that listens for that, and starts a VNC server on the existing X session, allowing connections before login.<br />
<span id="more-435"></span></p>
<h2>Step 1</h2>
<p> – we want the VNC server to have a password, just in case – the VNC port shouldn’t really be exposed to the outside world – it’s easy to wrap it in an SSH connection to encrypt everything for you (see here for a good explanation of how to set that up).<br />
<code>$ sudo x11vnc -storepasswd /etc/x11vnc.pass</code><br />
This will prompt you for a password to (lightly) secure your VNC server.</p>
<h2>Step 2a</h2>
<p> (for LightDM – XUbuntu, and all Ubuntu variants 12.04 onwards) – create the upstart job. Put this in /etc/init/x11vnc.conf :<br />
<code>start on login-session-start<br />
script<br />
/usr/bin/x11vnc -xkb -auth /var/run/lightdm/root/:0 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5900 -o /var/log/x11vnc.log<br />
end script</code><br />
Note: if you’d like this to work with GDM instead, you’ll need to find where GDM puts its MIT-MAGIC-COOKIE – I believe it’s <var>/var/run/gdm/auth...</var> or something similar, although I haven’t got a box to test it on</p>
<h2>Step 2b</h2>
<p> (for lxdm – LUbuntu) – LXDM doesn’t seem to emit the right event, but instead is has /etc/lxdm/LoginReady which lets you specify pre-login events. However, we need to first get the xauth setup properly. Edit <var>/etc/lxdm/lxdm.conf</var> and uncomment the line:<br />
<code>xauth_path=/tmp</code><br />
This specifies that we’re going to use a different xauth path; we also need to update the /etc/lxdm/LoginReady file with our x11 command, using the updated xauth path.<br />
Put this in <var>/etc/lxdm/LoginReady</var>:<br />
<code>/usr/bin/x11vnc -xkb -auth /tmp/.Xauth1000 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5900 -o /var/log/x11vnc.log</code></p>
<h2>Step 2c</h2>
<p> (for mdm – Mint LMDE)<br />
Mint LMDE (Debian edition) doesn’t use the upstart things; instead, put this at the end of <var>/etc/mdm/Init/Default</var>:<br />
<code>/usr/bin/x11vnc -xkb -auth /var/lib/mdm/:0.Xauth -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5900 -o /var/log/x11vnc.log</code><br />
Note that this uses the auth path for mdm which is <var>/var/lib/mdm/:0.Xauth</var></p>
<h2>Step 3</h2>
<p> – Done!<br />
Reboot! That’s all there is to it – hopefully, you’ll now have a shared VNC server which connects to your main desktop X session, running on port 5900 using the password you gave, all started automatically as soon as LightDM asks you to login. Hooray!<br />
1. If you’d like to have a separated VNC server running too you can – make sure you have tightvncserver installed (or similar) and then put<br />
<code>[VNCServer]<br />
enabled=true<br />
port=5901 # I've used port 5901 so it doesn't interfere with the setup from above</code><br />
in your <var>/etc/lightdm/lightdm.conf</var> then reboot – should have a separate X session available for VNC’ing into.</p>
<p><strong>Quoted:</strong> <a href="http://seb.so/vnc-from-boot-without-logging-in-ubuntu-lubuntu-xubuntu-and-mint-lmde/">http://seb.so/vnc-from-boot-without-logging-in-ubuntu-lubuntu-xubuntu-and-mint-lmde/</a></p>
]]></content:encoded>
			<wfw:commentRss>https://falconia.org/blog/archives/435/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
