/* server we're connecting to */
 extern const char* hostname;
 
+/* port which to connect to the server via vnc */
+extern int ovirt_server_vnc_port;
+
 /* vm currently in focus */
 extern struct vm* vm_in_focus;
 
 
 /*  internal.h shared constructs */
 const char* hostname;
 struct vm* vm_in_focus;
+int ovirt_server_vnc_port = 5900;
 
 /* Private functions. */
 static void start_ui (void);
   "Use '" PACKAGE " --help' to see a list of available command line options";
 
 static const GOptionEntry options[] = {
+  { "port", 'p', 0, G_OPTION_ARG_INT, &ovirt_server_vnc_port,
+    "set port which to connect to server via vnc", NULL },
   { "cainfo", 0, 0, G_OPTION_ARG_STRING, &cainfo,
     "set the path of the CA certificate bundle", NULL },
   { "check-certificate", 0, 0, G_OPTION_ARG_NONE, &check_cert,
 
 // max length of vnc data
 const int VNC_DATA_MAX_LEN = 800000;
 
-// port which to connect to on ovirt server
-const int OVIRT_SERVER_PORT = 5900;
-
 /* Private thread functions */
 static gpointer tunnel_thread(gpointer data);
 static gpointer client_server_thread(gpointer data);
   }
   ovirt_server_address.sin_family = PF_INET;
   ovirt_server_address.sin_addr.s_addr = ((struct in_addr*)(dns_serv->h_addr))->s_addr; //inet_addr(hostname);
-  ovirt_server_address.sin_port = htons(OVIRT_SERVER_PORT);
+  ovirt_server_address.sin_port = htons(ovirt_server_vnc_port);
   ovirt_server_len = sizeof(ovirt_server_address);
 
   // create local net socket
      ovirt_server_socket = socket(PF_INET, SOCK_STREAM, 0);
      c_socket = malloc(sizeof(int)); *c_socket = ovirt_server_socket;
      sockets = g_slist_prepend(sockets, c_socket);
-     DEBUG ("connecting to ovirt server %s on %i", hostname, OVIRT_SERVER_PORT);
+     DEBUG ("connecting to ovirt server %s on %i", hostname, ovirt_server_vnc_port);
      if(connect(ovirt_server_socket, (struct sockaddr*)&ovirt_server_address, ovirt_server_len) < 0){
        DEBUG ("could not connect to ovirt server");
        break;