Skip to contentSkip to conversation

How to run KVM on non-X environment

DISCUSSION Stephen Liu 4 participants 12 messages Jul 28, 2008 – Jul 29, 2008 KVM

lore
Share & tools
lore
#0 lore raw

Hi folks,

Ubuntu 8.04 server amd64, headless
KVM 1:62+dfsg
QEMU 0.9.1
OpenSSH 1:4.7p1

On running

# kvm -m 750 -cdrom /dev/scd0 -boot d ubuntu6.06.img
     =======================|  DirectFB 1.0.1  |=======================
          (c) 2001-2007  The DirectFB Organization (directfb.org)
          (c) 2000-2004  Convergence (integrated media) GmbH
        ------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2008-04-08 15:15) (*) Direct/Memcpy: Using libc memcpy()
(!) Direct/Util: opening '/dev/fb0' and '/dev/fb/0' failed

    --> No such file or directory

(!) DirectFB/FBDev: Error opening framebuffer device!
(!) DirectFB/FBDev: Use 'fbdev' option or set FRAMEBUFFER environment variable.
(!) DirectFB/Core: Could not initialize 'system' core!

    --> Initialization error!

Could not initialize SDL - exiting

Please advise how to fix the problem. TIA

B.R.
Stephen L

Send instant messages to your online friends http://uk.messenger.yahoo.com

#1 lore raw
Quoted 3 lines · Stephen Liu

On running

# kvm -m 750 -cdrom /dev/scd0 -boot d ubuntu6.06.img

add -vnc :<number>

or disable graphics completly (see kvm --help)

- Thomas

#2 lore raw

Re: How to run KVM on non-X environment (RESEND)

Quoted 10 lines · --- Thomas Mueller
Quoted 3 lines · Stephen Liu

On running

# kvm -m 750 -cdrom /dev/scd0 -boot d ubuntu6.06.img

add -vnc :<number>

or disable graphics completly (see kvm --help)

Hi Thomas,

Thanks for your advice.

There is no graphic running on the server which is headless. I configure the server remotely via ssh connection on a workstation.

Please explain in more detail. The CD running on /dev/scd0 is an installer to install Ubuntu 6.06 NOT an ISO image.

TIA

B.R.
Stephen L

Send instant messages to your online friends http://uk.messenger.yahoo.com

#3 lore raw

Re: How to run KVM on non-X environment (RESEND)

Quoted 16 lines · Stephen Liu
Quoted 8 lines
Quoted 4 lines

On running

# kvm -m 750 -cdrom /dev/scd0 -boot d ubuntu6.06.img

add -vnc :<number>

or disable graphics completly (see kvm --help)

Hi Thomas,

Thanks for your advice.

Quoted 6 lines

There is no graphic running on the server which is headless. I configure the server remotely via ssh connection on a workstation.

Please explain in more detail. The CD running on /dev/scd0 is an installer to install Ubuntu 6.06 NOT an ISO image.

so if you want to access the "vga monitor" of the virtual machine, you have to add "-vnc :0" and then connect with a vnc to "physical-host-ip-or- dnsname:0"

- Thomas

http://en.wikipedia.org/wiki/Virtual_Network_Computing

#4 lore raw

Re: How to run KVM on non-X environment (RESEND)

Quoted 26 lines · --- Thomas Mueller
Quoted 16 lines · Stephen Liu
Quoted 8 lines
Quoted 4 lines

On running

# kvm -m 750 -cdrom /dev/scd0 -boot d ubuntu6.06.img

add -vnc :<number>

or disable graphics completly (see kvm --help)

Hi Thomas,

Thanks for your advice.

Quoted 6 lines

There is no graphic running on the server which is headless. I configure the server remotely via ssh connection on a workstation.

Please explain in more detail. The CD running on /dev/scd0 is an installer to install Ubuntu 6.06 NOT an ISO image.

Quoted 7 lines

so if you want to access the "vga monitor" of the virtual machine, you
have to add "-vnc :0" and then connect with a vnc to "physical-host-ip-or-
dnsname:0"

http://en.wikipedia.org/wiki/Virtual_Network_Computing

Hi Thomas,

Thanks for your advice and URL.

Performed following test but failed.

# kvm -hda ubuntu6.06.img -cdrom /dev/scd0 -m 512 -boot d -vnc IP:0
Could not parse VNC address
# kvm -hda ubuntu6.06.img -cdrom /dev/scd0 -m 512 -boot d -vnc IP:1
Could not parse VNC address
# dpkg -l | grep vnc
No printout

I suppose VNC not installed. Which of the following packages need to install?
vnc4server
linuxvnc
python-gtk-vnc

TIA

B.R.
Stephen

Send instant messages to your online friends http://uk.messenger.yahoo.com

#5 lore raw

Re: How to run KVM on non-X environment (RESEND)

Quoted 6 lines

Thanks for your advice and URL.

Quoted 7 lines

Performed following test but failed.

# kvm -hda ubuntu6.06.img -cdrom /dev/scd0 -m 512 -boot d -vnc IP:0
Could not parse VNC address
# kvm -hda ubuntu6.06.img -cdrom /dev/scd0 -m 512 -boot d -vnc IP:1

on kvm-machine) kvm -hda ubuntu6.06.img -cdrom /dev/scd0 -m 512 -boot d \
-vnc :1

on another host with) vncviewer kvm-machine:1

- Thomas

#6 lore raw

Hi Thomas,

--- Thomas Mueller <[email protected]> wrote:

- snip -

Quoted 5 lines
Quoted 1 line
# kvm -hda ubuntu6.06.img -cdrom /dev/scd0 -m 512 -boot d -vnc IP:1

on kvm-machine) kvm -hda ubuntu6.06.img -cdrom /dev/scd0 -m 512 -boot d \
-vnc :1

On the server running;

# kvm -hda ubuntu6.06.img -cdrom /dev/scd0 -m 512 -boot d -vnc :1

It was hanging there.

Quoted 1 line

on another host with) vncviewer kvm-machine:1

Unfortnately I don't have vncviewer running on the local desktop. What can I do? TIA

On local desktop Xterm after ssh-connect the server;

# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address        
State       PID/Program name
tcp        0      0 0.0.0.0:5901            0.0.0.0:*              
LISTEN      5682/kvm        
tcp        0      0 192.168.122.1:53        0.0.0.0:*              
LISTEN      5100/dnsmasq    
tcp6       0      0 :::22                   :::*                   
LISTEN      5561/sshd       
tcp6       0      0 192.168.0.110:22        192.168.0.36:45338     
ESTABLISHED 5566/0          

Is the VM running?

Which packages I have to install for vncviewr, vnc-client, etc. ?

B.R.
Stephen

Send instant messages to your online friends http://uk.messenger.yahoo.com

#7 lore raw
Quoted 3 lines · Stephen Liu
# kvm -hda ubuntu6.06.img -cdrom /dev/scd0 -m 512 -boot d -vnc :1

It was hanging there.

it's not a hang. it's running, but all feedback goes to the VNC port. maybe you'd like it to run in the background, so you get the prompt back. just add a '&' at the end:

kvm -hda ubuntu6.06.img -cdrom /dev/scd0 -m 512 -boot d -vnc :1 &

Quoted 16 lines

On local desktop Xterm after ssh-connect the server;

# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address
State       PID/Program name
tcp        0      0 0.0.0.0:5901            0.0.0.0:*
LISTEN      5682/kvm
tcp        0      0 192.168.122.1:53        0.0.0.0:*
LISTEN      5100/dnsmasq
tcp6       0      0 :::22                   :::*
LISTEN      5561/sshd
tcp6       0      0 192.168.0.110:22        192.168.0.36:45338
ESTABLISHED 5566/0
Quoted 1 line

Is the VM running?

yes, and port 5901 is VNC's port 1 (since you used -vnc :1)

you do need a VNC client. it would be the 'screen and keyboard' of the virtual machine. you need at least that to install an OS. after that, you could setup any kind of network access you like directly to the VM (ssh, X, RDP, etc)

Signature · 1 line
Javier
#8 lore raw

Hi Javier,

Thanks for your advice.

Quoted 29 lines · --- Javier Guerra Giraldez
Quoted 3 lines · Stephen Liu
# kvm -hda ubuntu6.06.img -cdrom /dev/scd0 -m 512 -boot d -vnc :1

It was hanging there.

it's not a hang. it's running, but all feedback goes to the VNC port. maybe
you'd like it to run in the background, so you get the prompt back. just add
a '&' at the end:

kvm -hda ubuntu6.06.img -cdrom /dev/scd0 -m 512 -boot d -vnc :1 &

Quoted 16 lines

On local desktop Xterm after ssh-connect the server;

# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address
State       PID/Program name
tcp        0      0 0.0.0.0:5901            0.0.0.0:*
LISTEN      5682/kvm
tcp        0      0 192.168.122.1:53        0.0.0.0:*
LISTEN      5100/dnsmasq
tcp6       0      0 :::22                   :::*
LISTEN      5561/sshd
tcp6       0      0 192.168.0.110:22        192.168.0.36:45338
ESTABLISHED 5566/0
Quoted 7 lines
Quoted 1 line

Is the VM running?

yes, and port 5901 is VNC's port 1 (since you used -vnc :1)

you do need a VNC client. it would be the 'screen and keyboard' of the
virtual machine. you need at least that to install an OS.

I ran Knoppix 5.1 on a PC using tightvnc viewer to install the OS, Ubuntu6.06 as guest. It is working now. I also ran update and upgrade afterwards.

However I haven't figured out how to start it on next boot. Do I need putting the installer on CDRom? On next boot what command shall I run to start KVM. What command shall I run to start the guest. How to resize the vncviewer window? TIA

Quoted 5 lines

after
that, you
could setup any kind of network access you like directly to the VM (ssh, X,
RDP, etc)

Please explain in more detail. ssh is running on the host. Thanks

B.R.
Stephen

Send instant messages to your online friends http://uk.messenger.yahoo.com

#9 lore raw
In reply to Thomas Mueller
Quoted 5 lines · --- Thomas Mueller

on kvm-machine) kvm -hda ubuntu6.06.img -cdrom /dev/scd0 -m 512 -boot d \
-vnc :1

on another host with) vncviewer kvm-machine:1

Hi Thomas,

I got it by running Knoppix 5.1-1 LiveCD which has vncviewer installed.

On local desktop;

$ vncviewer 192.168.0.110:1
Connected to RFB server, using protocol version 3.7
No authentication needed
Desktop name "QEMU/KVM"
VNC server default format:
  32 bits per pixel.
  Least significant byte first in each pixel.
  True colour: max red 255 green 255 blue 255, shift red 16 green 8
blue 0
Using default colormap which is TrueColor.  Pixel format:
  16 bits per pixel.
  Least significant byte first in each pixel.
  True colour: max red 31 green 63 blue 31, shift red 11 green 5 blue 0
Using shared memory PutImage
ShmCleanup called

The installation window started. I think I can proceed installing the guest OS? However I stopped here because I can bring the mouse in action over the said window. Nor the keyboard did function well. How to improve them? TIA

Another question;

If I need to do all steps remotely on local desktop I need to start 2 Xterms to ssh connect the server.

One to run the command;

# kvm -hda ubuntu6.06.img -cdrom /dev/scd0 -m 512 -boot d -vnc :1

it will hang after executing the command

Another Xterm to run;

# vncview 192.168.0.110:1

Is there a clue? TIA

B.R.
Stephen

Send instant messages to your online friends http://uk.messenger.yahoo.com

#11 lore raw
Quoted 5 lines · --- Ian Kirk
Quoted 1 line · Stephen Liu

Please advise how to fix the problem. TIA

Why not just use -vnc :0 or -curses ?

Hi Ian,

Please explain in more detail how to make it. TIA

B.R.
Stephen L

Send instant messages to your online friends http://uk.messenger.yahoo.com