In my last post, new VM has been built and started, now how can we install the operating system and other application on that host from Command Line Interface.
This can be achieved by enable the VNC (Virtual Network Computing) settings in Virtual Machine configuration to access from remote host.
Step 1: Login to Oracle Virtual Server.
[root@mgmtsrv ~]# ssh ovs01.lab.local
root@ovs01.lab.local's password:
Last login: Sat Dec 23 05:24:55 2017 from 10.10.10.1
Warning: making manual modifications in the management domain
might cause inconsistencies between Oracle VM Manager and the server.
Step 2: Check the VM console port number.
[root@ovs01 ~]# xm list
Name ID Mem VCPUs State Time(s)
0004fb0000060000524f9d3e43fd71f3 1 515 1 ------ 1.5
Domain-0 0 814 4 r----- 89.9
[root@ovs01 ~]# xm list -l | grep location
(location 5)
(location 127.0.0.1:5900)
[root@ovs01 ~]# netstat -antulp | grep 5900
tcp 0 0 127.0.0.1:5900 0.0.0.0:* LISTEN 2537/qemu-dm
If you see above netstat output, the console port 5900 mapped to localhost. Which means that VM can be accessible only from local Oracle VM Server, we can’t connect the VM host from remote machine. But in next step we are going to define the vnclisten address to overcome this problem.
Go to Virtual Machine configuration path.
[root@ovs01 ~]# cd /OVS/Repositories/0004fb000003000082b0d717e2f9871d/VirtualMachines/0004fb0000060000524f9d3e43fd71f3
Add the below vfb parameter to enable the VNC to access from anywhere.
[root@ovs01 0004fb0000060000524f9d3e43fd71f3]# echo "vfb = ['type=vnc,vncunused=1,vnclisten=0.0.0.0,vncpasswd=hello123']" >> vm.cfg
[root@ovs01 0004fb0000060000524f9d3e43fd71f3]# cat vm.cfg | grep vfb
vfb = ['type=vnc,vncunused=1,vnclisten=0.0.0.0,vncpasswd=hello123']
vnc = 1 # vnc=1 enabled, 0=disabled
vncconsole = 1 # vncconsole=1 enables spawning VNC viewer for domain’s console. Default=0
vnclisten = 0.0.0.0 # sets VNC to allow access to any computer
vncpasswd = ‘hello123’ # VNC password
vncunused = 1 # vncunused=1 – find an unused port for the VNC server to listen on. Default=1
Step 3: Access VM host from Oracle VM Manager.
Install Required Packages in Oracle VM Manager
[root@ovm ~]# yum install -y xorg-x11-server-Xorg xorg-x11-xauth xorg-x11-apps
Enable X11 SSH Forwarding in the /etc/ssh/ssh_config file.
Uncomment or add the below lines.
X11Forwarding yes
Restart SSH Service
[root@ovm ~]# /etc/init.d/sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
Download and install Xming
Once you installed Xming, Select Xming and click XLaunch and proceed with default parameters.
Configure Putty
1. Open Putty and Enter the OVM server hostname or ipaddress
2. Go to Connection -> SSH -> X11 -> Enable X11 forwarding checkbox
3. Set the X display location as localhost:10.0
4. Finally click Open button
5. Login as root user
[root@ovm ~]# echo $DISPLAY
localhost:10.0
By executing below command we can make sure X11 options enabled on this machine.
[root@ovm ~]# xclock
[root@ovm ~]# xeyes
Connect to the guest on the host computer with the command
[root@ovm ~]# vncviewer -Shared ovs01.lab.local:5900
TigerVNC Viewer for X version 1.1.0 - built Sep 22 2014 07:14:05
Copyright (C) 1999-2011 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Sun Dec 17 06:21:36 2017
CConn: connected to host ovs01.lab.local port 5900
CConnection: Server supports RFB protocol version 3.8
CConnection: Using RFB protocol version 3.8
Sun Dec 17 06:21:39 2017
TXImage: Using default colormap and visual, TrueColor, depth 24.
CConn: Using pixel format depth 24 (32bpp) little-endian rgb888
CConn: Using Tight encoding
That’s it. Now you can able to access the VM host and start installing the Operating System.