cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [26/50] [abbrv] git commit: refs/heads/ui-plugins - Moved console-proxy into services
Date Wed, 13 Feb 2013 22:04:21 GMT
Moved console-proxy into services


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/4869f0ca
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/4869f0ca
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/4869f0ca

Branch: refs/heads/ui-plugins
Commit: 4869f0cacfc1319ac725e35ac4ebd1b59da8e5e1
Parents: 2293caa
Author: Alex Huang <alex.huang@citrix.com>
Authored: Tue Feb 12 15:59:02 2013 -0800
Committer: Alex Huang <alex.huang@citrix.com>
Committed: Tue Feb 12 16:00:14 2013 -0800

----------------------------------------------------------------------
 services/console-proxy/plugin/pom.xml              |   35 +
 services/console-proxy/pom.xml                     |   37 +
 .../server/bindir/cloud-setup-console-proxy.in     |  220 +++
 services/console-proxy/server/certs/localhost.crt  |   22 +
 services/console-proxy/server/certs/localhost.key  |   27 +
 services/console-proxy/server/certs/realhostip.crt |   31 +
 services/console-proxy/server/certs/realhostip.csr |   15 +
 services/console-proxy/server/certs/realhostip.key |   24 +
 .../console-proxy/server/certs/realhostip.keystore |  Bin 0 -> 8690 bytes
 .../server/conf.dom0/agent.properties.in           |   46 +
 .../server/conf.dom0/consoleproxy.properties.in    |   23 +
 .../server/conf.dom0/log4j-cloud.xml.in            |  101 +
 .../console-proxy/server/conf/agent.properties     |   19 +
 .../server/conf/consoleproxy.properties            |   23 +
 services/console-proxy/server/conf/log4j-cloud.xml |  102 +
 services/console-proxy/server/css/ajaxviewer.css   |  144 ++
 services/console-proxy/server/css/logger.css       |  139 ++
 .../SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in  |   98 +
 .../SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in  |   98 +
 .../SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in  |   98 +
 .../SYSCONFDIR/init.d/cloud-console-proxy.in       |  112 ++
 services/console-proxy/server/images/back.gif      |  Bin 0 -> 149 bytes
 .../console-proxy/server/images/bright-green.png   |  Bin 0 -> 3903 bytes
 services/console-proxy/server/images/cad.gif       |  Bin 0 -> 918 bytes
 .../console-proxy/server/images/cannotconnect.jpg  |  Bin 0 -> 1810 bytes
 .../console-proxy/server/images/clr_button.gif     |  Bin 0 -> 1274 bytes
 .../server/images/clr_button_hover.gif             |  Bin 0 -> 437 bytes
 services/console-proxy/server/images/dot.cur       |  Bin 0 -> 326 bytes
 .../console-proxy/server/images/gray-green.png     |  Bin 0 -> 3833 bytes
 .../console-proxy/server/images/grid_headerbg.gif  |  Bin 0 -> 196 bytes
 services/console-proxy/server/images/left.png      |  Bin 0 -> 3024 bytes
 .../server/images/minimize_button.gif              |  Bin 0 -> 634 bytes
 .../server/images/minimize_button_hover.gif        |  Bin 0 -> 227 bytes
 services/console-proxy/server/images/notready.jpg  |  Bin 0 -> 1827 bytes
 .../console-proxy/server/images/play_button.gif    |  Bin 0 -> 657 bytes
 .../server/images/play_button_hover.gif            |  Bin 0 -> 243 bytes
 services/console-proxy/server/images/right.png     |  Bin 0 -> 3131 bytes
 services/console-proxy/server/images/right2.png    |  Bin 0 -> 3156 bytes
 .../console-proxy/server/images/shrink_button.gif  |  Bin 0 -> 655 bytes
 .../server/images/shrink_button_hover.gif          |  Bin 0 -> 243 bytes
 .../console-proxy/server/images/stop_button.gif    |  Bin 0 -> 649 bytes
 .../server/images/stop_button_hover.gif            |  Bin 0 -> 231 bytes
 services/console-proxy/server/images/winlog.png    |  Bin 0 -> 2629 bytes
 services/console-proxy/server/js/ajaxkeys.js       |   77 +
 services/console-proxy/server/js/ajaxviewer.js     | 1444 +++++++++++++++
 services/console-proxy/server/js/cloud.logger.js   |  338 ++++
 services/console-proxy/server/js/handler.js        |   72 +
 services/console-proxy/server/js/jquery.js         |   19 +
 .../server/libexec/console-proxy-runner.in         |   90 +
 services/console-proxy/server/pom.xml              |  247 +++
 services/console-proxy/server/scripts/_run.sh      |   63 +
 .../console-proxy/server/scripts/config_auth.sh    |   69 +
 .../console-proxy/server/scripts/config_ssl.sh     |  174 ++
 .../console-proxy/server/scripts/ipfirewall.sh     |   50 +
 services/console-proxy/server/scripts/run-proxy.sh |   48 +
 services/console-proxy/server/scripts/run.bat      |   18 +
 services/console-proxy/server/scripts/run.sh       |   45 +
 .../console-proxy/server/scripts/ssvm-check.sh     |  136 ++
 .../com/cloud/consoleproxy/AjaxFIFOImageCache.java |   83 +
 .../consoleproxy/AuthenticationException.java      |   33 +
 .../src/com/cloud/consoleproxy/ConsoleProxy.java   |  499 +++++
 .../consoleproxy/ConsoleProxyAjaxHandler.java      |  406 ++++
 .../consoleproxy/ConsoleProxyAjaxImageHandler.java |  159 ++
 .../ConsoleProxyAuthenticationResult.java          |   81 +
 .../ConsoleProxyBaseServerFactoryImpl.java         |   48 +
 .../com/cloud/consoleproxy/ConsoleProxyClient.java |   69 +
 .../cloud/consoleproxy/ConsoleProxyClientBase.java |  457 +++++
 .../consoleproxy/ConsoleProxyClientListener.java   |   25 +
 .../consoleproxy/ConsoleProxyClientParam.java      |  110 ++
 .../ConsoleProxyClientStatsCollector.java          |   88 +
 .../cloud/consoleproxy/ConsoleProxyCmdHandler.java |   70 +
 .../cloud/consoleproxy/ConsoleProxyGCThread.java   |  109 ++
 .../ConsoleProxyHttpHandlerHelper.java             |   74 +
 .../consoleproxy/ConsoleProxyLoggerFactory.java    |   89 +
 .../cloud/consoleproxy/ConsoleProxyMonitor.java    |  153 ++
 .../ConsoleProxyPasswordBasedEncryptor.java        |  142 ++
 .../consoleproxy/ConsoleProxyResourceHandler.java  |  181 ++
 .../ConsoleProxySecureServerFactoryImpl.java       |  145 ++
 .../consoleproxy/ConsoleProxyServerFactory.java    |   29 +
 .../consoleproxy/ConsoleProxyThumbnailHandler.java |  212 +++
 .../cloud/consoleproxy/ConsoleProxyVncClient.java  |  235 +++
 .../src/com/cloud/consoleproxy/InputEventType.java |   58 +
 .../cloud/consoleproxy/util/ITileScanListener.java |   25 +
 .../com/cloud/consoleproxy/util/ImageHelper.java   |   32 +
 .../src/com/cloud/consoleproxy/util/Logger.java    |  223 +++
 .../com/cloud/consoleproxy/util/LoggerFactory.java |   21 +
 .../src/com/cloud/consoleproxy/util/RawHTTP.java   |  249 +++
 .../src/com/cloud/consoleproxy/util/Region.java    |   90 +
 .../cloud/consoleproxy/util/RegionClassifier.java  |   58 +
 .../src/com/cloud/consoleproxy/util/TileInfo.java  |   55 +
 .../com/cloud/consoleproxy/util/TileTracker.java   |  269 +++
 .../consoleproxy/vnc/BufferedImageCanvas.java      |  150 ++
 .../cloud/consoleproxy/vnc/FrameBufferCanvas.java  |   30 +
 .../vnc/FrameBufferUpdateListener.java             |   26 +
 .../vnc/PaintNotificationListener.java             |   27 +
 .../com/cloud/consoleproxy/vnc/RfbConstants.java   |   82 +
 .../src/com/cloud/consoleproxy/vnc/VncClient.java  |  451 +++++
 .../consoleproxy/vnc/VncClientPacketSender.java    |  258 +++
 .../consoleproxy/vnc/VncScreenDescription.java     |   89 +
 .../consoleproxy/vnc/VncServerPacketReceiver.java  |  123 ++
 .../vnc/packet/client/ClientPacket.java            |   26 +
 .../client/FramebufferUpdateRequestPacket.java     |   53 +
 .../vnc/packet/client/KeyboardEventPacket.java     |   42 +
 .../vnc/packet/client/MouseEventPacket.java        |   43 +
 .../vnc/packet/client/SetEncodingsPacket.java      |   45 +
 .../vnc/packet/client/SetPixelFormatPacket.java    |   75 +
 .../vnc/packet/server/AbstractRect.java            |   53 +
 .../consoleproxy/vnc/packet/server/CopyRect.java   |   39 +
 .../server/FrameBufferSizeChangeRequest.java       |   39 +
 .../vnc/packet/server/FramebufferUpdatePacket.java |  102 +
 .../consoleproxy/vnc/packet/server/RawRect.java    |   75 +
 .../cloud/consoleproxy/vnc/packet/server/Rect.java |   33 +
 .../vnc/packet/server/ServerCutText.java           |   49 +
 .../console-proxy/server/systemvm-descriptor.xml   |  113 ++
 .../console-proxy/server/ui/viewer-bad-sid.ftl     |   29 +
 .../server/ui/viewer-connect-failed.ftl            |   29 +
 services/console-proxy/server/ui/viewer-update.ftl |   24 +
 services/console-proxy/server/ui/viewer.ftl        |   60 +
 services/console-proxy/server/vm-script/vmops      |  119 ++
 services/pom.xml                                   |   36 +
 120 files changed, 11201 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/plugin/pom.xml
----------------------------------------------------------------------
diff --git a/services/console-proxy/plugin/pom.xml b/services/console-proxy/plugin/pom.xml
new file mode 100644
index 0000000..8cf3d76
--- /dev/null
+++ b/services/console-proxy/plugin/pom.xml
@@ -0,0 +1,35 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>cloud-plugin-console-proxy</artifactId>
+  <name>Apache CloudStack Console Proxy Plugin</name>
+  <packaging>pom</packaging>
+  <parent>
+    <groupId>org.apache.cloudstack</groupId>
+    <artifactId>cloud-service-console-proxy</artifactId>
+    <version>4.1.0-SNAPSHOT</version>
+    <relativePath>../pom.xml</relativePath>
+  </parent>
+  <build>
+    <defaultGoal>install</defaultGoal>
+	<sourceDirectory>src</sourceDirectory>
+	<testSourceDirectory>test</testSourceDirectory>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/pom.xml
----------------------------------------------------------------------
diff --git a/services/console-proxy/pom.xml b/services/console-proxy/pom.xml
new file mode 100644
index 0000000..cd57526
--- /dev/null
+++ b/services/console-proxy/pom.xml
@@ -0,0 +1,37 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>cloud-service-console-proxy</artifactId>
+  <name>Apache CloudStack Console Proxy Service</name>
+  <packaging>pom</packaging>
+  <parent>
+    <groupId>org.apache.cloudstack</groupId>
+    <artifactId>cloud-services</artifactId>
+    <version>4.1.0-SNAPSHOT</version>
+    <relativePath>../pom.xml</relativePath>
+  </parent>
+  <build>
+    <defaultGoal>install</defaultGoal>
+  </build>
+  <modules>
+    <module>plugin</module>
+    <module>server</module>
+  </modules>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/bindir/cloud-setup-console-proxy.in
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/bindir/cloud-setup-console-proxy.in b/services/console-proxy/server/bindir/cloud-setup-console-proxy.in
new file mode 100755
index 0000000..6439c0f
--- /dev/null
+++ b/services/console-proxy/server/bindir/cloud-setup-console-proxy.in
@@ -0,0 +1,220 @@
+#!/usr/bin/env python
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+import sys, os, subprocess, errno, re, getopt
+
+# ---- This snippet of code adds the sources path and the waf configured PYTHONDIR to the Python path ----
+# ---- We do this so cloud_utils can be looked up in the following order:
+# ---- 1) Sources directory
+# ---- 2) waf configured PYTHONDIR
+# ---- 3) System Python path
+for pythonpath in (
+		"@PYTHONDIR@",
+		os.path.join(os.path.dirname(__file__),os.path.pardir,os.path.pardir,"python","lib"),
+	):
+		if os.path.isdir(pythonpath): sys.path.insert(0,pythonpath)
+# ---- End snippet of code ----
+import cloud_utils
+from cloud_utils import stderr
+
+E_GENERIC= 1
+E_NOKVM = 2
+E_NODEFROUTE = 3
+E_DHCP = 4
+E_NOPERSISTENTNET = 5
+E_NETRECONFIGFAILED = 6
+E_VIRTRECONFIGFAILED = 7
+E_FWRECONFIGFAILED = 8
+E_CPRECONFIGFAILED = 9
+E_CPFAILEDTOSTART = 10
+E_NOFQDN = 11
+
+def bail(errno=E_GENERIC,message=None,*args):
+	if message: stderr(message,*args)
+	stderr("Cloud Console Proxy setup aborted")
+	sys.exit(errno)
+
+
+#---------------- boilerplate for python 2.4 support 
+
+
+# CENTOS does not have this -- we have to put this here
+try:
+	from subprocess import check_call
+	from subprocess import CalledProcessError
+except ImportError:
+	def check_call(*popenargs, **kwargs):
+		import subprocess
+		retcode = subprocess.call(*popenargs, **kwargs)
+		cmd = kwargs.get("args")
+		if cmd is None: cmd = popenargs[0]
+		if retcode: raise CalledProcessError(retcode, cmd)
+		return retcode
+
+	class CalledProcessError(Exception):
+		def __init__(self, returncode, cmd):
+			self.returncode = returncode ; self.cmd = cmd
+		def __str__(self): return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode)
+
+# ------------ end boilerplate -------------------------
+
+def check_hostname(): return check_call(["hostname",'--fqdn'])
+
+class Command:
+	def __init__(self,name,parent=None):
+		self.__name = name
+		self.__parent = parent
+	def __getattr__(self,name):
+		if name == "_print": name = "print"
+		return Command(name,self)
+	def __call__(self,*args):
+		cmd = self.__get_recursive_name() + list(args)
+		#print "	",cmd
+		popen = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+		m = popen.communicate()
+		ret = popen.wait()
+		if ret:
+			e = CalledProcessError(ret,cmd)
+			e.stdout,e.stderr = m
+			raise e
+		class CommandOutput:
+			def __init__(self,stdout,stderr):
+				self.stdout = stdout
+				self.stderr = stderr
+		return CommandOutput(*m)
+	def __lt__(self,other):
+		cmd = self.__get_recursive_name()
+		#print "	",cmd,"<",other
+		popen = subprocess.Popen(cmd,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+		m = popen.communicate(other)
+		ret = popen.wait()
+		if ret:
+			e = CalledProcessError(ret,cmd)
+			e.stdout,e.stderr = m
+			raise e
+		class CommandOutput:
+			def __init__(self,stdout,stderr):
+				self.stdout = stdout
+				self.stderr = stderr
+		return CommandOutput(*m)
+		
+	def __get_recursive_name(self,sep=None):
+		m = self
+		l = []
+		while m is not None:
+			l.append(m.__name)
+			m = m.__parent
+		l.reverse()
+		if sep: return sep.join(l)
+		else: return l
+	def __str__(self):
+		return '<Command %r>'%self.__get_recursive_name(sep=" ")
+		
+	def __repr__(self): return self.__str__()
+
+ip = Command("ip")
+service = Command("service")
+chkconfig = Command("chkconfig")
+ufw = Command("ufw")
+iptables = Command("iptables")
+augtool = Command("augtool")
+ifconfig = Command("ifconfig")
+uuidgen = Command("uuidgen")
+
+Fedora = os.path.exists("/etc/fedora-release")
+CentOS = os.path.exists("/etc/centos-release") or ( os.path.exists("/etc/redhat-release") and not os.path.exists("/etc/fedora-release") )
+
+#--------------- procedure starts here ------------
+
+def main():
+	# parse cmd line	
+	opts, args = getopt.getopt(sys.argv[1:], "a", ["host=", "zone=", "pod="])
+	host=None
+	zone=None
+	pod=None
+    	autoMode=False
+	do_check_kvm = True	
+	for opt, arg in opts:
+		if opt == "--host":
+			if arg != "":
+				host = arg
+		elif opt == "--zone":
+			if arg != "":
+				zone = arg
+		elif opt == "--pod":
+		        if arg != "":
+				pod = arg
+        	elif opt == "-a":
+            		autoMode=True
+	servicename = "@PACKAGE@-console-proxy"
+	
+	if autoMode:
+		cloud_utils.setLogFile("/var/log/cloud/setupConsoleProxy.log")
+
+	stderr("Welcome to the Cloud Console Proxy setup")
+	stderr("")
+
+	try:
+		check_hostname()
+		stderr("The hostname of this machine is properly set up")
+	except CalledProcessError,e:
+		bail(E_NOFQDN,"This machine does not have an FQDN (fully-qualified domain name) for a hostname")
+
+	stderr("Stopping the Cloud Console Proxy")
+	cloud_utils.stop_service(servicename)
+	stderr("Cloud Console Proxy stopped")
+
+	ports = "8002".split()
+	if Fedora or CentOS:
+		try:
+			o = chkconfig("--list","iptables")
+			if ":on" in o.stdout and os.path.exists("/etc/sysconfig/iptables"):
+				stderr("Setting up firewall rules to permit traffic to Cloud services")
+				service.iptables.start() ; print o.stdout + o.stderr
+				for p in ports: iptables("-I","INPUT","1","-p","tcp","--dport",p,'-j','ACCEPT')
+				o = service.iptables.save() ; print o.stdout + o.stderr
+		except CalledProcessError,e:
+			print e.stdout+e.stderr
+			bail(E_FWRECONFIGFAILED,"Firewall rules could not be set")
+	else:
+		stderr("Setting up firewall rules to permit traffic to Cloud services")
+		try:
+			for p in ports: ufw.allow(p)
+			stderr("Rules set")
+		except CalledProcessError,e:
+			print e.stdout+e.stderr
+			bail(E_FWRECONFIGFAILED,"Firewall rules could not be set")
+
+		stderr("We are going to enable ufw now.  This may disrupt network connectivity and service availability.  See the ufw documentation for information on how to manage ufw firewall policies.")
+		try:
+			o = ufw.enable < "y\n" ; print o.stdout + o.stderr
+		except CalledProcessError,e:
+			print e.stdout+e.stderr
+			bail(E_FWRECONFIGFAILED,"Firewall could not be enabled")
+
+	cloud_utils.setup_consoleproxy_config("@CPSYSCONFDIR@/agent.properties", host, zone, pod)
+	stderr("Enabling and starting the Cloud Console Proxy")
+	cloud_utils.enable_service(servicename)
+	stderr("Cloud Console Proxy restarted")
+
+if __name__ == "__main__":
+	main()
+
+# FIXMES: 1) nullify networkmanager on ubuntu (asking the user first) and enable the networking service permanently

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/certs/localhost.crt
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/certs/localhost.crt b/services/console-proxy/server/certs/localhost.crt
new file mode 100644
index 0000000..005d98b
--- /dev/null
+++ b/services/console-proxy/server/certs/localhost.crt
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIDrTCCApWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJVUzEL
+MAkGA1UECAwCQ0ExEjAQBgNVBAcMCUN1cGVydGlubzESMBAGA1UECgwJQ2xvdWQu
+Y29tMRAwDgYDVQQLDAdEZWZhdWx0MRswGQYDVQQDDBJTZWNvbmRhcnlTdG9yYWdl
+Vk0wHhcNMTAwNTI3MTgzNjI1WhcNMTMwMjIwMTgzNjI1WjBxMQswCQYDVQQGEwJV
+UzELMAkGA1UECAwCQ0ExEjAQBgNVBAcMCUN1cGVydGlubzESMBAGA1UECgwJQ2xv
+dWQuY29tMRAwDgYDVQQLDAdEZWZhdWx0MRswGQYDVQQDDBJTZWNvbmRhcnlTdG9y
+YWdlVk0wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCbhstQ5Gn2gzrk
+ZX1es+tuz4rnrcONRHUzyY/UdoT5jiVfmmS9CML/GgSpKzmnEMNZcCSh7G/GKPwD
+gBZywpTVD56nYT4ZzK0GjPxcg0a+BvxxA2esQ2/kFBvtdcZ1TNExtjdOqysjK0It
+M6U2891wbn+Y9oHqooTA0uaZELTpe/MCg2eBx7A4+u26novHHfOaKEEqtBscpDP8
+0+nQduNQf61haV25Lv2CDqrCIuv/FrNmgQhcUg8e1dFkk4VCsflEDuSYh9PpaD7J
+t+oqmNTVw8k6u3JAYJFkcu457uYz0wrED7Cai7Y6gUy7xwmY2SSY/r2mJJHEpSpZ
+NhiH47kZAgMBAAGjUDBOMB0GA1UdDgQWBBQ2hUX5Jdhn277SBisACnEABqg52zAf
+BgNVHSMEGDAWgBQ2hUX5Jdhn277SBisACnEABqg52zAMBgNVHRMEBTADAQH/MA0G
+CSqGSIb3DQEBBQUAA4IBAQBAVrkGGDPHDPQdZRgI1+1L87sX5xdNoet9sJUVRtz9
+ZwhGWAmca30cJGlhSFNx5y01E6T7lHDLrF9HCf9nVC10t0FwQwTVYijE8VyM7fAA
+4Hv/whSKg1kkQQSTis2ZW0wMU6TnanhJy6MrxwdhRampeXjNOpNtoLrF/5LbhWxO
+Gm0S5u+4q7eYnUPD4o3sb17idG62kkejHeToPnJwXtDwyq0XYNlL/OoqRaaY5f0b
+IKdeqqEkdtkzfU4N1dG7bJA29gBl48gPn+CSrh9u3D0s1OYM7MWi1/TjpwCR18ir
+CslVzO6kVNyQoNEYhZ9+2Sz0ceZVrYDFFzp8qAF8qbZ7
+-----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/certs/localhost.key
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/certs/localhost.key b/services/console-proxy/server/certs/localhost.key
new file mode 100644
index 0000000..6d95765
--- /dev/null
+++ b/services/console-proxy/server/certs/localhost.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAm4bLUORp9oM65GV9XrPrbs+K563DjUR1M8mP1HaE+Y4lX5pk
+vQjC/xoEqSs5pxDDWXAkoexvxij8A4AWcsKU1Q+ep2E+GcytBoz8XINGvgb8cQNn
+rENv5BQb7XXGdUzRMbY3TqsrIytCLTOlNvPdcG5/mPaB6qKEwNLmmRC06XvzAoNn
+gcewOPrtup6Lxx3zmihBKrQbHKQz/NPp0HbjUH+tYWlduS79gg6qwiLr/xazZoEI
+XFIPHtXRZJOFQrH5RA7kmIfT6Wg+ybfqKpjU1cPJOrtyQGCRZHLuOe7mM9MKxA+w
+mou2OoFMu8cJmNkkmP69piSRxKUqWTYYh+O5GQIDAQABAoIBAQCI5S8VNtimaYBv
+BX5C26+BzCECKIsWT4myWdrGMsR9PUdcTXQaiBnLncU4epm2miS5FuLHvGvuSqj5
+E8eun+ONXsBRqGCXKPer6nE/pTWhklilyU9566oTYjfq3l4fZcxFK5SnJDdGL4+C
+ZhEou6LQkhKyO1jDhOXBLGJZnMEBOf+zXhgZGLDbQwCcCQ5PAZUiSf0cnVRk3rI9
+GwdsbCDNJk6awy8ANlFATemDvHwHZ7ZwmvVzsjsYlYJbY/vJYlOyxa7tzYROVAlm
+m8oiPfDvGjnXcGxVQwT0pgDvwtUkUFijZORpkJOPavxqSkpOzDFrOe9UW6HJYGzH
+ujhmZBVhAoGBAMnbfssRwYI5egfsxNbA62NkxRcGe5HIlnyZ1Ln0BCE8ae60frcf
+4IluZzT53Ly3jUQP2uGdp6nJVq/5ymRYSySNr46DXek2qcJ2TMbtRBhjebPwi+Rb
+qTNjccNSgqs0j+1qP78PoTUO5fUWGL9XqIlfPU6Vji4+SmdNMvz6z84lAoGBAMU9
+/3l2WVXykD6FNrRbtvpzU1C9LDixOaVVpGnZHO8krW440LnhIZJbkXnXDVZXc7eI
+D/doecfL8rtFteqeBr0LiXGQXU5mIMjXAOAPSvDqIciYzhL8KOK5CWEgVZo6RQlU
+G3ne0mk93I+w8N0SE2VKeuxepz4yw0oiKUpAgWrlAoGAS06qNRSAvxa2YjKBFSWQ
+K9qydO6kNzVAf2fcpytURxoE41tPUv5/hIY91tPI+Fb6SwQnQrjQjlVhE/H7Agi2
+sAJ0FpUH+jO8jaIY7rYiC39BLlJ1vlI8A8H79UTZHwpTD93tvlgUankObas6vFf1
+tppjgufkzXfLxlJUzXC9CkkCgYA7gy9YOKtP0XZQRuVwmdOl0bIrxEhZeq/IAQUw
+or+mMEzb2uyviQwWGubT+l0d1hkmITmgDrff3tuIQcpX1gJ2e8qmp0Zf51SxBJ5Q
+/IxCEILNAb374HV9oxL/aUAq3rYB0IzRwrd95ZptCJhEO7X6c/SO6ShRDgP6lEAd
+FUV3OQKBgQCFC0Xx/fCX1yquARgoe5pbK7IpXWaTvjBu//gbHsfR2lk3dZbESdeg
+OquPDdfp+jFPGISsDhPLzcfkZIPbz5ZVs8KdmpB/YLwyJwFqjDyjwVaDnRnuycb1
+/4PlVWKp7j5SDDNCfleYvmiRn8k6P4mxVJOHKzwb/IwQcKghyqAF1w==
+-----END RSA PRIVATE KEY-----

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/certs/realhostip.crt
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/certs/realhostip.crt b/services/console-proxy/server/certs/realhostip.crt
new file mode 100644
index 0000000..7520b0c
--- /dev/null
+++ b/services/console-proxy/server/certs/realhostip.crt
@@ -0,0 +1,31 @@
+-----BEGIN CERTIFICATE-----
+MIIFZTCCBE2gAwIBAgIHKBCduBUoKDANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE
+BhMCVVMxEDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAY
+BgNVBAoTEUdvRGFkZHkuY29tLCBJbmMuMTMwMQYDVQQLEypodHRwOi8vY2VydGlm
+aWNhdGVzLmdvZGFkZHkuY29tL3JlcG9zaXRvcnkxMDAuBgNVBAMTJ0dvIERhZGR5
+IFNlY3VyZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTERMA8GA1UEBRMIMDc5Njky
+ODcwHhcNMTIwMjAzMDMzMDQwWhcNMTcwMjA3MDUxMTIzWjBZMRkwFwYDVQQKDBAq
+LnJlYWxob3N0aXAuY29tMSEwHwYDVQQLDBhEb21haW4gQ29udHJvbCBWYWxpZGF0
+ZWQxGTAXBgNVBAMMECoucmVhbGhvc3RpcC5jb20wggEiMA0GCSqGSIb3DQEBAQUA
+A4IBDwAwggEKAoIBAQCDT9AtEfs+s/I8QXp6rrCw0iNJ0+GgsybNHheU+JpL39LM
+TZykCrZhZnyDvwdxCoOfE38Sa32baHKNds+y2SHnMNsOkw8OcNucHEBX1FIpOBGp
+h9D6xC+umx9od6xMWETUv7j6h2u+WC3OhBM8fHCBqIiAol31/IkcqDxxsHlQ8S/o
+CfTlXJUY6Yn628OA1XijKdRnadV0hZ829cv/PZKljjwQUTyrd0KHQeksBH+YAYSo
+2JUl8ekNLsOi8/cPtfojnltzRI1GXi0ZONs8VnDzJ0a2gqZY+uxlz+CGbLnGnlN4
+j9cBpE+MfUE+35Dq121sTpsSgF85Mz+pVhn2S633AgMBAAGjggG+MIIBujAPBgNV
+HRMBAf8EBTADAQEAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAOBgNV
+HQ8BAf8EBAMCBaAwMwYDVR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5nb2RhZGR5
+LmNvbS9nZHMxLTY0LmNybDBTBgNVHSAETDBKMEgGC2CGSAGG/W0BBxcBMDkwNwYI
+KwYBBQUHAgEWK2h0dHA6Ly9jZXJ0aWZpY2F0ZXMuZ29kYWRkeS5jb20vcmVwb3Np
+dG9yeS8wgYAGCCsGAQUFBwEBBHQwcjAkBggrBgEFBQcwAYYYaHR0cDovL29jc3Au
+Z29kYWRkeS5jb20vMEoGCCsGAQUFBzAChj5odHRwOi8vY2VydGlmaWNhdGVzLmdv
+ZGFkZHkuY29tL3JlcG9zaXRvcnkvZ2RfaW50ZXJtZWRpYXRlLmNydDAfBgNVHSME
+GDAWgBT9rGEyk2xF1uLuhV+auud2mWjM5zArBgNVHREEJDAighAqLnJlYWxob3N0
+aXAuY29tgg5yZWFsaG9zdGlwLmNvbTAdBgNVHQ4EFgQUZyJz9/QLy5TWIIscTXID
+E8Xk47YwDQYJKoZIhvcNAQEFBQADggEBAKiUV3KK16mP0NpS92fmQkCLqm+qUWyN
+BfBVgf9/M5pcT8EiTZlS5nAtzAE/eRpBeR3ubLlaAogj4rdH7YYVJcDDLLoB2qM3
+qeCHu8LFoblkb93UuFDWqRaVPmMlJRnhsRkL1oa2gM2hwQTkBDkP7w5FG1BELCgl
+gZI2ij2yxjge6pOEwSyZCzzbCcg9pN+dNrYyGEtB4k+BBnPA3N4r14CWbk+uxjrQ
+6j2Ip+b7wOc5IuMEMl8xwTyjuX3lsLbAZyFI9RCyofwA9NqIZ1GeB6Zd196rubQp
+93cmBqGGjZUs3wMrGlm7xdjlX6GQ9UvmvkMub9+lL99A5W50QgCmFeI=
+-----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/certs/realhostip.csr
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/certs/realhostip.csr b/services/console-proxy/server/certs/realhostip.csr
new file mode 100644
index 0000000..61395c9
--- /dev/null
+++ b/services/console-proxy/server/certs/realhostip.csr
@@ -0,0 +1,15 @@
+-----BEGIN NEW CERTIFICATE REQUEST-----
+MIICsDCCAZgCAQAwazELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlDdXBlcnRp
+bm8xDjAMBgNVBAoTBVZNT3BzMRAwDgYDVQQLEwdVbmtub3duMRkwFwYDVQQDDBAqLnJlYWxob3N0
+aXAuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg0/QLRH7PrPyPEF6eq6wsNIj
+SdPhoLMmzR4XlPiaS9/SzE2cpAq2YWZ8g78HcQqDnxN/Emt9m2hyjXbPstkh5zDbDpMPDnDbnBxA
+V9RSKTgRqYfQ+sQvrpsfaHesTFhE1L+4+odrvlgtzoQTPHxwgaiIgKJd9fyJHKg8cbB5UPEv6An0
+5VyVGOmJ+tvDgNV4oynUZ2nVdIWfNvXL/z2SpY48EFE8q3dCh0HpLAR/mAGEqNiVJfHpDS7DovP3
+D7X6I55bc0SNRl4tGTjbPFZw8ydGtoKmWPrsZc/ghmy5xp5TeI/XAaRPjH1BPt+Q6tdtbE6bEoBf
+OTM/qVYZ9kut9wIDAQABoAAwDQYJKoZIhvcNAQEFBQADggEBAF5lhhni9dW9MqSL2ixNbViPWpFS
+ecOggshYChJfZKrhsuZaDpumJ/+ebICS4zv/oxDwNLSmeAmydiaUQC9LFQEEwvPBYDTtTzwCrtwH
+yyFJQSm6pyeIBP/Bih/5hLW8JPm0bDbp5ldrHCDEgKQeeyQhyYOKFODkTuMLw+FLD+V86IVHxElL
+/urCRWyZEPwyMsgfsU6ywNX9XNShyk1uDHjFDE67sPhfw52ooxXrYQnBdTk+g0UXPbULzrCK/1kU
+fjRq347V9Fwi5NFyGADOaA+q6mtnlb1i3uH1n1YVUzevvpnIr3/RxPSYHB47Kj9iYKeDlYdTRHJy
+NpuvTfmQO2Y=
+-----END NEW CERTIFICATE REQUEST-----

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/certs/realhostip.key
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/certs/realhostip.key b/services/console-proxy/server/certs/realhostip.key
new file mode 100644
index 0000000..53bdc86
--- /dev/null
+++ b/services/console-proxy/server/certs/realhostip.key
@@ -0,0 +1,24 @@
+-----BEGIN PRIVATE KEY-----
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCDT9AtEfs+s/I8QXp6rrCw0iNJ
+0+GgsybNHheU+JpL39LMTZykCrZhZnyDvwdxCoOfE38Sa32baHKNds+y2SHnMNsOkw8OcNucHEBX
+1FIpOBGph9D6xC+umx9od6xMWETUv7j6h2u+WC3OhBM8fHCBqIiAol31/IkcqDxxsHlQ8S/oCfTl
+XJUY6Yn628OA1XijKdRnadV0hZ829cv/PZKljjwQUTyrd0KHQeksBH+YAYSo2JUl8ekNLsOi8/cP
+tfojnltzRI1GXi0ZONs8VnDzJ0a2gqZY+uxlz+CGbLnGnlN4j9cBpE+MfUE+35Dq121sTpsSgF85
+Mz+pVhn2S633AgMBAAECggEAH/Szd9RxbVADenCA6wxKSa3KErRyq1YN8ksJeCKMAj0FIt0caruE
+qO11DebWW8cwQu1Otl/cYI6pmg24/BBldMrp9IELX/tNJo+lhPpRyGAxxC0eSXinFfoASb8d+jJd
+Bd1mmemM6fSxqRlxSP4LrzIhjhR1g2CiyYuTsiM9UtoVKGyHwe7KfFwirUOJo3Mr18zUVNm7YqY4
+IVhOSq59zkH3ULBlYq4bG50jpxa5mNSCZ7IpafPY/kE/CbR+FWNt30+rk69T+qb5abg6+XGm+OAm
+bnQ18yZEqX6nJLk7Ch0cfA5orGgrTMOrM71wK7tBBDQ308kOxDGebx6j0qD36QKBgQDTRDr8kuhA
+9sUyKr9vk2DQCMpNvEeiwI3JRMqmmxpNAtg01aJ3Ya57vX5Fc+zcuV87kP6FM1xgpHQvnw5LWo2J
+s7ANwQcP8ricEW5zkZhSjI4ssMeAubmsHOloGxmLFYZqwx0JI7CWViGTLMcUlqKblmHcjeQDeDfP
+P1TaCItFmwKBgQCfHZwVvIcaDs5vxVpZ4ftvflIrW8qq0uOVK6QIf9A/YTGhCXl2qxxTg2A6+0rg
+ZqI7zKzUDxIbVv0KlgCbpHDC9d5+sdtDB3wW2pimuJ3p1z4/RHb4n/lDwXCACZl1S5l24yXX2pFZ
+wdPCXmy5PYkHMssFLNhI24pprUIQs66M1QKBgQDQwjAjWisD3pRXESSfZRsaFkWJcM28hdbVFhPF
+c6gWhwQLmTp0CuL2RPXcPUPFi6sN2iWWi3zxxi9Eyz+9uBn6AsOpo56N5MME/LiOnETO9TKb+Ib6
+rQtKhjshcv3XkIqFPo2XdVvOAgglPO7vajX91iiXXuH7h7RmJud6l0y/lwKBgE+bi90gLuPtpoEr
+VzIDKz40ED5bNYHT80NNy0rpT7J2GVN9nwStRYXPBBVeZq7xCpgqpgmO5LtDAWULeZBlbHlOdBwl
+NhNKKl5wzdEUKwW0yBL1WSS5PQgWPwgARYP25/ggW22sj+49WIo1neXsEKPGWObk8e050f1fTt92
+Vo1lAoGAb1gCoyBCzvi7sqFxm4V5oapnJeiQQJFjhoYWqGa26rQ+AvXXNuBcigIeDXNJPctSF0Uc
+p11KbbCgiruBbckvM1vGsk6Sx4leRk+IFHRpJktFUek4o0eUg0shOsyyvyet48Dfg0a8FvcxROs0
+gD+IYds5doiob/hcm1hnNB/3vk4=
+-----END PRIVATE KEY-----
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/certs/realhostip.keystore
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/certs/realhostip.keystore b/services/console-proxy/server/certs/realhostip.keystore
new file mode 100644
index 0000000..c8d54d4
Binary files /dev/null and b/services/console-proxy/server/certs/realhostip.keystore differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/conf.dom0/agent.properties.in
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/conf.dom0/agent.properties.in b/services/console-proxy/server/conf.dom0/agent.properties.in
new file mode 100644
index 0000000..1920481
--- /dev/null
+++ b/services/console-proxy/server/conf.dom0/agent.properties.in
@@ -0,0 +1,46 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Sample configuration file for VMOPS console proxy
+
+instance=ConsoleProxy
+consoleproxy.httpListenPort=8002
+
+#resource= the java class, which agent load to execute
+resource=com.cloud.agent.resource.consoleproxy.ConsoleProxyResource
+
+#host= The IP address of management server
+host=localhost
+
+#port = The port management server listening on, default is 8250
+port=8250
+
+#pod= The pod, which agent belonged to
+pod=default
+
+#zone= The zone, which agent belonged to
+zone=default
+
+#private.network.device= the private nic device
+# if this is commented, it is autodetected on service startup
+# private.network.device=cloudbr0
+
+#public.network.device= the public nic device
+# if this is commented, it is autodetected on service startup
+# public.network.device=cloudbr0
+
+#guid= a GUID to identify the agent

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/conf.dom0/consoleproxy.properties.in
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/conf.dom0/consoleproxy.properties.in b/services/console-proxy/server/conf.dom0/consoleproxy.properties.in
new file mode 100644
index 0000000..a3cddbc
--- /dev/null
+++ b/services/console-proxy/server/conf.dom0/consoleproxy.properties.in
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+consoleproxy.tcpListenPort=0
+consoleproxy.httpListenPort=80
+consoleproxy.httpCmdListenPort=8001
+consoleproxy.jarDir=./applet/
+consoleproxy.viewerLinger=180
+consoleproxy.reconnectMaxRetry=5

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/conf.dom0/log4j-cloud.xml.in
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/conf.dom0/log4j-cloud.xml.in b/services/console-proxy/server/conf.dom0/log4j-cloud.xml.in
new file mode 100644
index 0000000..dde844f
--- /dev/null
+++ b/services/console-proxy/server/conf.dom0/log4j-cloud.xml.in
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <!-- ================================= -->
+   <!-- Preserve messages in a local file -->
+   <!-- ================================= -->
+
+   <!-- A time/date based rolling appender -->
+   <appender name="FILE" class="org.apache.log4j.rolling.RollingFileAppender">
+      <param name="Append" value="true"/>
+      <param name="Threshold" value="WARN"/>
+      <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
+        <param name="FileNamePattern" value="@CPLOG@.%d{yyyy-MM-dd}.gz"/>
+        <param name="ActiveFileName" value="@CPLOG@"/>
+      </rollingPolicy>
+      <layout class="org.apache.log4j.EnhancedPatternLayout">
+         <param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{3}] (%t:%x) %m%n"/>
+      </layout>
+   </appender>
+   
+   <!-- ============================== -->
+   <!-- Append messages to the console -->
+   <!-- ============================== -->
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="WARN"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n"/>
+      </layout>
+   </appender>
+
+   <!-- ================ -->
+   <!-- Limit categories -->
+   <!-- ================ -->
+
+   <category name="com.cloud.console.ConsoleCanvas">
+     <priority value="WARN"/>
+   </category>
+   
+   <category name="com.cloud.consoleproxy.ConsoleProxyAjaxImageHandler">
+     <priority value="WARN"/>
+   </category>
+   
+   <category name="com.cloud.consoleproxy.ConsoleProxyViwer">
+     <priority value="WARN"/>
+   </category>
+
+   <category name="com.cloud.consoleproxy">
+     <priority value="INFO"/>
+   </category>
+
+   <category name="com.cloud">
+     <priority value="DEBUG"/>
+   </category>
+   
+   <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+   <category name="org.apache">
+      <priority value="INFO"/>
+   </category>
+
+   <category name="org">
+      <priority value="INFO"/>
+   </category>
+   
+   <category name="net">
+     <priority value="INFO"/>
+   </category>
+
+   <!-- ======================= -->
+   <!-- Setup the Root category -->
+   <!-- ======================= -->
+
+   <root>
+      <level value="INFO"/>
+      <appender-ref ref="CONSOLE"/>
+      <appender-ref ref="FILE"/>
+   </root>
+
+</log4j:configuration>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/conf/agent.properties
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/conf/agent.properties b/services/console-proxy/server/conf/agent.properties
new file mode 100644
index 0000000..4e217f2
--- /dev/null
+++ b/services/console-proxy/server/conf/agent.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+instance=ConsoleProxy
+resource=com.cloud.agent.resource.consoleproxy.ConsoleProxyResource

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/conf/consoleproxy.properties
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/conf/consoleproxy.properties b/services/console-proxy/server/conf/consoleproxy.properties
new file mode 100644
index 0000000..bb452f5
--- /dev/null
+++ b/services/console-proxy/server/conf/consoleproxy.properties
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+consoleproxy.tcpListenPort=0
+consoleproxy.httpListenPort=8088
+consoleproxy.httpCmdListenPort=8001
+consoleproxy.jarDir=./applet/
+consoleproxy.viewerLinger=180
+consoleproxy.reconnectMaxRetry=5

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/conf/log4j-cloud.xml
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/conf/log4j-cloud.xml b/services/console-proxy/server/conf/log4j-cloud.xml
new file mode 100644
index 0000000..5b31c9d
--- /dev/null
+++ b/services/console-proxy/server/conf/log4j-cloud.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <!-- ================================= -->
+   <!-- Preserve messages in a local file -->
+   <!-- ================================= -->
+
+   <!-- A time/date based rolling appender -->
+   <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
+      <param name="File" value="/var/log/cloud/systemvm.log"/>
+      <param name="Append" value="true"/>
+      <param name="Threshold" value="DEBUG"/>
+
+      <!-- Rollover at midnight each day -->
+      <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d %-5p [%c{3}] (%t:%x) %m%n"/>
+      </layout>
+   </appender>
+   
+   <!-- ============================== -->
+   <!-- Append messages to the console -->
+   <!-- ============================== -->
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="WARN"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n"/>
+      </layout>
+   </appender>
+
+   <!-- ================ -->
+   <!-- Limit categories -->
+   <!-- ================ -->
+
+   <category name="com.cloud.console.ConsoleCanvas">
+     <priority value="WARN"/>
+   </category>
+   
+   <category name="com.cloud.consoleproxy.ConsoleProxyAjaxImageHandler">
+     <priority value="WARN"/>
+   </category>
+   
+   <category name="com.cloud.consoleproxy.ConsoleProxyViewer">
+     <priority value="WARN"/>
+   </category>
+
+   <category name="com.cloud.consoleproxy">
+     <priority value="INFO"/>
+   </category>
+
+   <category name="com.cloud">
+     <priority value="DEBUG"/>
+   </category>
+   
+   <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+   <category name="org.apache">
+      <priority value="INFO"/>
+   </category>
+
+   <category name="org">
+      <priority value="INFO"/>
+   </category>
+   
+   <category name="net">
+     <priority value="INFO"/>
+   </category>
+
+   <!-- ======================= -->
+   <!-- Setup the Root category -->
+   <!-- ======================= -->
+
+   <root>
+      <level value="INFO"/>
+      <appender-ref ref="CONSOLE"/>
+      <appender-ref ref="FILE"/>
+   </root>
+
+</log4j:configuration>

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/css/ajaxviewer.css
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/css/ajaxviewer.css b/services/console-proxy/server/css/ajaxviewer.css
new file mode 100644
index 0000000..5ea552b
--- /dev/null
+++ b/services/console-proxy/server/css/ajaxviewer.css
@@ -0,0 +1,144 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+body {
+	margin:0 0;
+	text-align: center;
+}
+	
+#main_panel {
+	clear:both;
+	margin: 0 auto;
+	text-align: left;
+}
+
+.canvas_tile {
+	cursor:crosshair;
+}
+
+#toolbar {
+	font:normal 12px 'Trebuchet MS','Arial'; 
+	margin:0 auto; 
+	text-align: left;
+	padding:0 0; 
+	height:32px;
+	background-image:url(/resource/images/back.gif); 
+	background-repeat:repeat-x; 
+}
+
+#toolbar ul { 
+	margin:0 0; 
+	padding:0 10px 0 10px; 
+	float:left;
+	display:block;
+	line-height:32px;
+	list-style:none; 
+}
+
+#toolbar li {
+	float:left; 
+	display:inline; 
+	padding:0;
+	height:32px;
+}
+
+#toolbar a { 
+	color:white; 
+	float:left;
+	display:block;
+	padding:0 3px 0 3px; 
+	text-decoration:none;
+	line-height:32px;
+}
+
+#toolbar a span { 
+	display:block; 
+	float:none; 
+	padding:0 10px 0 7px; 
+} 
+
+#toolbar a span img { 
+	border:none; 
+	margin:8px 4px 0 0; 
+} 
+
+#toolbar a:hover { 
+	background: url(/resource/images/left.png) no-repeat left center; 
+} 
+
+#toolbar a:hover span { 
+	background:url(/resource/images/right.png) no-repeat right center; 
+}
+
+
+#toolbar ul li ul {
+    position: absolute;
+    top:32;
+    width: 260;
+    height: 65;
+    display: block;
+    display: none;
+    border-top: 1px solid black;
+    background-image:url(/resource/images/back.gif); 
+    background-repeat:repeat-x repeat-y; 
+}
+
+#toolbar ul li ul li {
+    display: list-item;
+    float:none;
+    padding-left: 20;
+}
+
+#toolbar ul li ul li.current {
+    background: url(/resource/images/cad.gif) no-repeat left center; 
+}
+
+#toolbar ul li ul li a {
+    display:block;
+    padding:0 3px 0 3px; 
+    text-decoration:none;
+    line-height:32px;
+    vertical-align: bottom;    /* this is to fix the list gap in IE */
+}
+
+#toolbar ul li ul li a:hover {
+    background: url(/resource/images/left.png) no-repeat left center; 
+}
+
+#toolbar ul li ul li a:hover span {
+    background: url(/resource/images/right2.png) no-repeat right center; 
+}
+
+span.dark {
+	margin-right:20px;
+	float:right;
+	display:block;
+	width:32px;
+	height:30px;
+	background:url(/resource/images/gray-green.png) no-repeat center center; 
+}
+
+span.bright {
+	margin-right:20px;
+	float:right;
+	display:block;
+	width:32px;
+	height:30px;
+	background:url(/resource/images/bright-green.png) no-repeat center center; 
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/css/logger.css
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/css/logger.css b/services/console-proxy/server/css/logger.css
new file mode 100644
index 0000000..42ac807
--- /dev/null
+++ b/services/console-proxy/server/css/logger.css
@@ -0,0 +1,139 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+@charset "UTF-8";
+.logwin {
+      position: absolute;
+
+      z-index:2147483648;
+      width: 800px;
+      border: 1px solid gray;
+      background: white;
+      text-align: left;
+}
+
+.logwin_title{
+	width:auto;
+	  height: 23px;
+	  background:url(../images/grid_headerbg.gif) repeat-x top left;
+	  border: 1px sold #737373;
+}
+
+.logwin_title_actionbox{
+	width:175px;
+	height:16px;
+	float:left;
+	margin:4px 0 0 7px;
+	display:inline;
+}
+
+
+.logwin_title_actionbox .select {
+	background: #424242; 
+	font: normal 10px Arial, Helvetica, sans-serif; 
+	float:left; 
+	border: 1px solid #6e6e6e; 
+	height: 16px; 
+	width: 100px; 
+	margin-left:3px; 
+	padding:0 0 0 3px; 
+	color:#CCC;
+}
+
+.logwin_title_rgtactionbox{
+	width:49px;
+	height:15px;
+	float:right;
+	margin:4px 0 0 7px;
+	display:inline;
+}
+
+
+a.logwin_playbutton {
+	width:18px;
+	height:15px;
+	float:left;
+	background:url(../images/play_button.gif) no-repeat top left;
+	margin-right:2px;
+	padding:0;
+}
+
+a:hover.logwin_playbutton {
+	background:url(../images/play_button_hover.gif) no-repeat top left;
+}
+
+a.logwin_stopbutton {
+	width:18px;
+	height:15px;
+	float:left;
+	background:url(../images/stop_button.gif) no-repeat top left;
+	margin-right:2px;
+	padding:0;
+}
+
+a:hover.logwin_stopbutton {
+	background:url(../images/stop_button_hover.gif) no-repeat top left;
+}
+
+a.logwin_clrbutton {
+	width:28px;
+	height:15px;
+	float:left;
+	background:url(../images/clr_button.gif) no-repeat top left;
+	margin:0;
+	padding:0;
+}
+
+a:hover.logwin_clrbutton {
+	background:url(../images/clr_button_hover.gif) no-repeat top left;
+}
+
+a.logwin_shrinkbutton {
+	width:18px;
+	height:15px;
+	float:right;
+	background:url(../images/shrink_button.gif) no-repeat top left;
+	margin-right:7px;
+	margin-top:4px;
+	padding:0;
+}
+
+a:hover.logwin_shrinkbutton {
+	background:url(../images/shrink_button_hover.gif) no-repeat top left;
+}
+
+a.logwin_minimizebutton {
+	width:18px;
+	height:15px;
+	float:left;
+	background:url(../images/minimize_button.gif) no-repeat top left;
+	margin-right:2px;
+	padding:0;
+}
+
+a:hover.logwin_minimizebutton {
+	background:url(../images/minimize_button_hover.gif) no-repeat top left;
+}
+
+.logwin_content {
+    overflow:scroll;
+    height: 477px;
+    background: white;
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/distro/centos/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/distro/centos/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in b/services/console-proxy/server/distro/centos/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in
new file mode 100644
index 0000000..47fdaef
--- /dev/null
+++ b/services/console-proxy/server/distro/centos/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in
@@ -0,0 +1,98 @@
+#!/bin/bash
+
+# chkconfig: 35 99 10
+# description: Cloud Console Proxy
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# WARNING: if this script is changed, then all other initscripts MUST BE changed to match it as well
+
+. /etc/rc.d/init.d/functions
+
+whatami=cloud-console-proxy
+
+# set environment variables
+
+SHORTNAME="$whatami"
+PIDFILE=@PIDDIR@/"$whatami".pid
+LOCKFILE=@LOCKDIR@/"$SHORTNAME"
+LOGFILE=@CPLOG@
+PROGNAME="Cloud Console Proxy"
+
+unset OPTIONS
+[ -r @SYSCONFDIR@/sysconfig/"$SHORTNAME" ] && source @SYSCONFDIR@/sysconfig/"$SHORTNAME"
+DAEMONIZE=@BINDIR@/@PACKAGE@-daemonize
+PROG=@LIBEXECDIR@/console-proxy-runner
+
+start() {
+        echo -n $"Starting $PROGNAME: "
+	if hostname --fqdn >/dev/null 2>&1 ; then
+		daemon --check=$SHORTNAME --pidfile=${PIDFILE} "$DAEMONIZE" \
+			-n "$SHORTNAME" -p "$PIDFILE" -l "$LOGFILE" "$PROG" $OPTIONS
+		RETVAL=$?
+		echo
+	else
+		failure
+		echo
+		echo The host name does not resolve properly to an IP address.  Cannot start "$PROGNAME". > /dev/stderr
+		RETVAL=9
+	fi
+	[ $RETVAL = 0 ] && touch ${LOCKFILE}
+	return $RETVAL
+}
+
+stop() {
+	echo -n $"Stopping $PROGNAME: "
+	killproc -p ${PIDFILE} $SHORTNAME # -d 10 $SHORTNAME
+	RETVAL=$?
+	echo
+	[ $RETVAL = 0 ] && rm -f ${LOCKFILE} ${PIDFILE}
+}
+
+
+# See how we were called.
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  status)
+        status -p ${PIDFILE} $SHORTNAME
+	RETVAL=$?
+	;;
+  restart)
+	stop
+	sleep 3
+	start
+	;;
+  condrestart)
+	if status -p ${PIDFILE} $SHORTNAME >&/dev/null; then
+		stop
+		sleep 3
+		start
+	fi
+	;;
+  *)
+	echo $"Usage: $whatami {start|stop|restart|condrestart|status|help}"
+	RETVAL=3
+esac
+
+exit $RETVAL
+

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/distro/fedora/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/distro/fedora/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in b/services/console-proxy/server/distro/fedora/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in
new file mode 100644
index 0000000..47fdaef
--- /dev/null
+++ b/services/console-proxy/server/distro/fedora/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in
@@ -0,0 +1,98 @@
+#!/bin/bash
+
+# chkconfig: 35 99 10
+# description: Cloud Console Proxy
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# WARNING: if this script is changed, then all other initscripts MUST BE changed to match it as well
+
+. /etc/rc.d/init.d/functions
+
+whatami=cloud-console-proxy
+
+# set environment variables
+
+SHORTNAME="$whatami"
+PIDFILE=@PIDDIR@/"$whatami".pid
+LOCKFILE=@LOCKDIR@/"$SHORTNAME"
+LOGFILE=@CPLOG@
+PROGNAME="Cloud Console Proxy"
+
+unset OPTIONS
+[ -r @SYSCONFDIR@/sysconfig/"$SHORTNAME" ] && source @SYSCONFDIR@/sysconfig/"$SHORTNAME"
+DAEMONIZE=@BINDIR@/@PACKAGE@-daemonize
+PROG=@LIBEXECDIR@/console-proxy-runner
+
+start() {
+        echo -n $"Starting $PROGNAME: "
+	if hostname --fqdn >/dev/null 2>&1 ; then
+		daemon --check=$SHORTNAME --pidfile=${PIDFILE} "$DAEMONIZE" \
+			-n "$SHORTNAME" -p "$PIDFILE" -l "$LOGFILE" "$PROG" $OPTIONS
+		RETVAL=$?
+		echo
+	else
+		failure
+		echo
+		echo The host name does not resolve properly to an IP address.  Cannot start "$PROGNAME". > /dev/stderr
+		RETVAL=9
+	fi
+	[ $RETVAL = 0 ] && touch ${LOCKFILE}
+	return $RETVAL
+}
+
+stop() {
+	echo -n $"Stopping $PROGNAME: "
+	killproc -p ${PIDFILE} $SHORTNAME # -d 10 $SHORTNAME
+	RETVAL=$?
+	echo
+	[ $RETVAL = 0 ] && rm -f ${LOCKFILE} ${PIDFILE}
+}
+
+
+# See how we were called.
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  status)
+        status -p ${PIDFILE} $SHORTNAME
+	RETVAL=$?
+	;;
+  restart)
+	stop
+	sleep 3
+	start
+	;;
+  condrestart)
+	if status -p ${PIDFILE} $SHORTNAME >&/dev/null; then
+		stop
+		sleep 3
+		start
+	fi
+	;;
+  *)
+	echo $"Usage: $whatami {start|stop|restart|condrestart|status|help}"
+	RETVAL=3
+esac
+
+exit $RETVAL
+

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/distro/rhel/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/distro/rhel/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in b/services/console-proxy/server/distro/rhel/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in
new file mode 100644
index 0000000..47fdaef
--- /dev/null
+++ b/services/console-proxy/server/distro/rhel/SYSCONFDIR/rc.d/init.d/cloud-console-proxy.in
@@ -0,0 +1,98 @@
+#!/bin/bash
+
+# chkconfig: 35 99 10
+# description: Cloud Console Proxy
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# WARNING: if this script is changed, then all other initscripts MUST BE changed to match it as well
+
+. /etc/rc.d/init.d/functions
+
+whatami=cloud-console-proxy
+
+# set environment variables
+
+SHORTNAME="$whatami"
+PIDFILE=@PIDDIR@/"$whatami".pid
+LOCKFILE=@LOCKDIR@/"$SHORTNAME"
+LOGFILE=@CPLOG@
+PROGNAME="Cloud Console Proxy"
+
+unset OPTIONS
+[ -r @SYSCONFDIR@/sysconfig/"$SHORTNAME" ] && source @SYSCONFDIR@/sysconfig/"$SHORTNAME"
+DAEMONIZE=@BINDIR@/@PACKAGE@-daemonize
+PROG=@LIBEXECDIR@/console-proxy-runner
+
+start() {
+        echo -n $"Starting $PROGNAME: "
+	if hostname --fqdn >/dev/null 2>&1 ; then
+		daemon --check=$SHORTNAME --pidfile=${PIDFILE} "$DAEMONIZE" \
+			-n "$SHORTNAME" -p "$PIDFILE" -l "$LOGFILE" "$PROG" $OPTIONS
+		RETVAL=$?
+		echo
+	else
+		failure
+		echo
+		echo The host name does not resolve properly to an IP address.  Cannot start "$PROGNAME". > /dev/stderr
+		RETVAL=9
+	fi
+	[ $RETVAL = 0 ] && touch ${LOCKFILE}
+	return $RETVAL
+}
+
+stop() {
+	echo -n $"Stopping $PROGNAME: "
+	killproc -p ${PIDFILE} $SHORTNAME # -d 10 $SHORTNAME
+	RETVAL=$?
+	echo
+	[ $RETVAL = 0 ] && rm -f ${LOCKFILE} ${PIDFILE}
+}
+
+
+# See how we were called.
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  status)
+        status -p ${PIDFILE} $SHORTNAME
+	RETVAL=$?
+	;;
+  restart)
+	stop
+	sleep 3
+	start
+	;;
+  condrestart)
+	if status -p ${PIDFILE} $SHORTNAME >&/dev/null; then
+		stop
+		sleep 3
+		start
+	fi
+	;;
+  *)
+	echo $"Usage: $whatami {start|stop|restart|condrestart|status|help}"
+	RETVAL=3
+esac
+
+exit $RETVAL
+

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/distro/ubuntu/SYSCONFDIR/init.d/cloud-console-proxy.in
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/distro/ubuntu/SYSCONFDIR/init.d/cloud-console-proxy.in b/services/console-proxy/server/distro/ubuntu/SYSCONFDIR/init.d/cloud-console-proxy.in
new file mode 100755
index 0000000..550f2fb
--- /dev/null
+++ b/services/console-proxy/server/distro/ubuntu/SYSCONFDIR/init.d/cloud-console-proxy.in
@@ -0,0 +1,112 @@
+#!/bin/bash
+
+# chkconfig: 35 99 10
+# description: Cloud Console Proxy
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# WARNING: if this script is changed, then all other initscripts MUST BE changed to match it as well
+
+. /lib/lsb/init-functions
+. /etc/default/rcS
+
+whatami=cloud-console-proxy
+
+# set environment variables
+
+SHORTNAME="$whatami"
+PIDFILE=@PIDDIR@/"$whatami".pid
+LOCKFILE=@LOCKDIR@/"$SHORTNAME"
+LOGFILE=@CPLOG@
+PROGNAME="Cloud Console Proxy"
+
+unset OPTIONS
+[ -r @SYSCONFDIR@/default/"$SHORTNAME" ] && source @SYSCONFDIR@/default/"$SHORTNAME"
+DAEMONIZE=@BINDIR@/@PACKAGE@-daemonize
+PROG=@LIBEXECDIR@/console-proxy-runner
+
+start() {
+        log_daemon_msg $"Starting $PROGNAME" "$SHORTNAME"
+	if [ -s "$PIDFILE" ] && kill -0 $(cat "$PIDFILE") >/dev/null 2>&1; then
+	      log_progress_msg "apparently already running"
+	      log_end_msg 0
+	      exit 0
+	fi
+	if hostname --fqdn >/dev/null 2>&1 ; then
+		true
+	else
+		log_failure_msg "The host name does not resolve properly to an IP address.  Cannot start $PROGNAME"
+		log_end_msg 1
+		exit 1
+	fi
+ 
+	if start-stop-daemon --start --quiet \
+		--pidfile "$PIDFILE" \
+		--exec "$DAEMONIZE" -- -n "$SHORTNAME" -p "$PIDFILE" -l "$LOGFILE" "$PROG" $OPTIONS
+		RETVAL=$?
+	    then
+		rc=0
+		sleep 1
+		if ! kill -0 $(cat "$PIDFILE") >/dev/null 2>&1; then
+		    log_failure_msg "$PROG failed to start"
+		    rc=1
+		fi
+	else
+		rc=1
+	fi
+
+	if [ $rc -eq 0 ]; then
+		log_end_msg 0
+	else
+		log_end_msg 1
+		rm -f "$PIDFILE"
+	fi
+}
+
+stop() {
+	echo -n $"Stopping $PROGNAME" "$SHORTNAME"
+	start-stop-daemon --stop --quiet --oknodo --pidfile "$PIDFILE"
+	log_end_msg $?
+	rm -f "$PIDFILE"
+}
+
+
+# See how we were called.
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  status)
+        status_of_proc -p "$PIDFILE" "$PROG" "$SHORTNAME"
+	RETVAL=$?
+	;;
+  restart)
+	stop
+	sleep 3
+	start
+	;;
+  *)
+	echo $"Usage: $whatami {start|stop|restart|status|help}"
+	RETVAL=3
+esac
+
+exit $RETVAL
+

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/back.gif
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/back.gif b/services/console-proxy/server/images/back.gif
new file mode 100644
index 0000000..5c61ae2
Binary files /dev/null and b/services/console-proxy/server/images/back.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/bright-green.png
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/bright-green.png b/services/console-proxy/server/images/bright-green.png
new file mode 100644
index 0000000..685dfc1
Binary files /dev/null and b/services/console-proxy/server/images/bright-green.png differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/cad.gif
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/cad.gif b/services/console-proxy/server/images/cad.gif
new file mode 100644
index 0000000..de34925
Binary files /dev/null and b/services/console-proxy/server/images/cad.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/cannotconnect.jpg
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/cannotconnect.jpg b/services/console-proxy/server/images/cannotconnect.jpg
new file mode 100644
index 0000000..0599f17
Binary files /dev/null and b/services/console-proxy/server/images/cannotconnect.jpg differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/clr_button.gif
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/clr_button.gif b/services/console-proxy/server/images/clr_button.gif
new file mode 100644
index 0000000..f5c3858
Binary files /dev/null and b/services/console-proxy/server/images/clr_button.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/clr_button_hover.gif
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/clr_button_hover.gif b/services/console-proxy/server/images/clr_button_hover.gif
new file mode 100644
index 0000000..f882fa0
Binary files /dev/null and b/services/console-proxy/server/images/clr_button_hover.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/dot.cur
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/dot.cur b/services/console-proxy/server/images/dot.cur
new file mode 100644
index 0000000..1721801
Binary files /dev/null and b/services/console-proxy/server/images/dot.cur differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/gray-green.png
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/gray-green.png b/services/console-proxy/server/images/gray-green.png
new file mode 100644
index 0000000..e785a63
Binary files /dev/null and b/services/console-proxy/server/images/gray-green.png differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/grid_headerbg.gif
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/grid_headerbg.gif b/services/console-proxy/server/images/grid_headerbg.gif
new file mode 100644
index 0000000..5a0f72b
Binary files /dev/null and b/services/console-proxy/server/images/grid_headerbg.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/left.png
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/left.png b/services/console-proxy/server/images/left.png
new file mode 100644
index 0000000..fb75066
Binary files /dev/null and b/services/console-proxy/server/images/left.png differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/minimize_button.gif
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/minimize_button.gif b/services/console-proxy/server/images/minimize_button.gif
new file mode 100644
index 0000000..a4e2e26
Binary files /dev/null and b/services/console-proxy/server/images/minimize_button.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/minimize_button_hover.gif
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/minimize_button_hover.gif b/services/console-proxy/server/images/minimize_button_hover.gif
new file mode 100644
index 0000000..7837ed0
Binary files /dev/null and b/services/console-proxy/server/images/minimize_button_hover.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/notready.jpg
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/notready.jpg b/services/console-proxy/server/images/notready.jpg
new file mode 100644
index 0000000..406599c
Binary files /dev/null and b/services/console-proxy/server/images/notready.jpg differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/play_button.gif
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/play_button.gif b/services/console-proxy/server/images/play_button.gif
new file mode 100644
index 0000000..6f48308
Binary files /dev/null and b/services/console-proxy/server/images/play_button.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/play_button_hover.gif
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/play_button_hover.gif b/services/console-proxy/server/images/play_button_hover.gif
new file mode 100644
index 0000000..6689e3e
Binary files /dev/null and b/services/console-proxy/server/images/play_button_hover.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/right.png
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/right.png b/services/console-proxy/server/images/right.png
new file mode 100644
index 0000000..4abac81
Binary files /dev/null and b/services/console-proxy/server/images/right.png differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/right2.png
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/right2.png b/services/console-proxy/server/images/right2.png
new file mode 100644
index 0000000..cca9379
Binary files /dev/null and b/services/console-proxy/server/images/right2.png differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/shrink_button.gif
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/shrink_button.gif b/services/console-proxy/server/images/shrink_button.gif
new file mode 100644
index 0000000..834625a
Binary files /dev/null and b/services/console-proxy/server/images/shrink_button.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/shrink_button_hover.gif
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/shrink_button_hover.gif b/services/console-proxy/server/images/shrink_button_hover.gif
new file mode 100644
index 0000000..eed9cec
Binary files /dev/null and b/services/console-proxy/server/images/shrink_button_hover.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/stop_button.gif
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/stop_button.gif b/services/console-proxy/server/images/stop_button.gif
new file mode 100644
index 0000000..bfec9c6
Binary files /dev/null and b/services/console-proxy/server/images/stop_button.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/stop_button_hover.gif
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/stop_button_hover.gif b/services/console-proxy/server/images/stop_button_hover.gif
new file mode 100644
index 0000000..c7c578f
Binary files /dev/null and b/services/console-proxy/server/images/stop_button_hover.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/images/winlog.png
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/images/winlog.png b/services/console-proxy/server/images/winlog.png
new file mode 100644
index 0000000..c7668c5
Binary files /dev/null and b/services/console-proxy/server/images/winlog.png differ

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4869f0ca/services/console-proxy/server/js/ajaxkeys.js
----------------------------------------------------------------------
diff --git a/services/console-proxy/server/js/ajaxkeys.js b/services/console-proxy/server/js/ajaxkeys.js
new file mode 100644
index 0000000..2ecf5b5
--- /dev/null
+++ b/services/console-proxy/server/js/ajaxkeys.js
@@ -0,0 +1,77 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+*/
+
+/*
+ * This var contains the limited keyboard translation tables.
+ * This is the table that users can modify to make special keyboard to work properly.
+ * They are used by the ajaxviewer.js
+ */
+
+//client event type. corresponds to events in ajaxviewer. 
+X11_KEY_CIRCUMFLEX_ACCENT = 0x5e;    // ^
+X11_KEY_YEN_MARK = 0xa5;
+X11_KEY_OPEN_BRACKET = 0x5b;
+X11_KEY_CLOSE_BRACKET = 0x5d;
+X11_KEY_COLON = 0x3a;
+X11_KEY_REVERSE_SOLIUS = 0x5c;       // another back slash (back slash on JP keyboard)
+X11_KEY_CAPSLOCK = 0xffe5;
+X11_KEY_SEMI_COLON = 0x3b;
+X11_KEY_SHIFT = 0xffe1;
+X11_KEY_ADD = 0x2b;
+
+KEY_DOWN = 5;
+KEY_UP = 6;
+
+//JP keyboard type
+// 
+var	keyboardTables = [
+           {tindex: 0, keyboardType: "EN-Cooked", mappingTable: 
+		{X11: [ {keycode: 222, entry: X11_KEY_CIRCUMFLEX_ACCENT},
+                        {keycode: 220, entry: X11_KEY_YEN_MARK},
+                        {keycode: 219, entry: X11_KEY_OPEN_BRACKET},
+                        {keycode: 221, entry: X11_KEY_CLOSE_BRACKET},
+                        {keycode: 59, entry: X11_KEY_COLON, browser: "Firefox"},
+                        {keycode: 186, entry: X11_KEY_COLON, browser: "Chrome"},
+                        {keycode: 9,  entry: 9, guestos: "XenServer"},
+                        {keycode: 226, entry: X11_KEY_REVERSE_SOLIUS},
+                        {keycode: 240, entry: [
+                            {type: KEY_DOWN, code: X11_KEY_CAPSLOCK, modifiers: 0 },
+                            {type: KEY_UP, code: X11_KEY_CAPSLOCK, modifiers: 0 },
+                            ]
+                        },
+ 		      ],
+	         keyPress: [
+                      {keycode: 59, entry: [
+                         {type: KEY_DOWN, code: X11_KEY_SEMI_COLON, modifiers: 0 },
+                         {type: KEY_UP, code: X11_KEY_SEMI_COLON, modifiers: 0 },
+                         ]
+                      },
+                      {keycode: 43, entry: [
+                         {type: KEY_DOWN, code: X11_KEY_SHIFT, modifiers: 0, shift: false },
+                         {type: KEY_DOWN, code: X11_KEY_ADD, modifiers: 0, shift: false },
+                         {type: KEY_UP, code: X11_KEY_ADD, modifiers: 0, shift: false },
+                         {type: KEY_UP, code: X11_KEY_SHIFT, modifiers: 0, shift: false },
+                         {type: KEY_DOWN, code: X11_KEY_ADD, modifiers: 0, shift: true },
+                         {type: KEY_UP, code: X11_KEY_ADD, modifiers: 0, shift: true },
+                         ]
+                      },
+                           ]
+		}
+	   }	]
+


Mime
View raw message