[one-users] Attach a console to kvm instance to debug network/boot issue

Javier Fontan jfontan at fdi.ucm.es
Thu Aug 27 02:46:57 PDT 2009


Hello,

This problem seems to be produced for executing the script with the
wrong interpreter. Some init systems execute those scripts with sh
even if you change the shebang to specify the interpreter for the
script. It needs to be bash. To correct this do not link vmcontext
script from init but use a proxy script to call it. Something like:

--8<------
#!/bin/sh

bash <place where vmcontext.sh is located> $@
------>8--

That should solve the errors you are getting.

Bye

On Wed, Aug 26, 2009 at 5:18 PM, Gavin<netmatters at gmail.com> wrote:
> 2009/8/26 Gavin <netmatters at gmail.com>:
>> After battling with the kvm console issue I decided to go back to Xen,
>> but I then realised that Xen support in Ubuntu/Debian is becoming less
>> and less, and Xen seems to have a lot of issues these days.
>>
>> So after you email I went back to kvm and made use of the vnc option
>> and I can now console successfully into my vm's.
>>
>> Now all I need to do is figure out how to modify the vmcontext.sh
>> script to be compatible with kvm.
>>
>> On this note, I notice that there is now another method to
>> contextualise a vm, the ISO method.
>>
>> Which is the recommended way to contextualise a vm and can anyone help
>> with some pointers on a dual-homed kvm guest ???
>>
>> Sorry, but I have only recently started using kvm so am still getting
>> to know how it works, what commands do what and so on.
>
> Ok, so I am making some decent progress here....
>
> Firstly the issue I was having with bringing up the interface(s) had
> to do with am incorrect mac prefix, so fixed that.
>
> Now I am using the vmcontext.sh script which is installed on the guest
> in /etc/init.d/vmcontext.sh which is symlinked to
> /etc/rc2.d/S01vmcontext.sh.
>
> When the VM boots I am seeing the following errors:-
>
> /etc/rc2.d/S01vmcontext.sh: 107: let: not found
>
> and
>
> [: 125: eth0: unexpected operator
>
> and
>
> /etc/rc2.d/S01vmcontext.sh: 125: let: not found
>
> and
>
> [: 125: eth0: unexpected operator
>
> and my /etc/network/interfaces looks like this:-
>
> auto lo
> iface lo inet loopback
>
> auto eth0
> iface eth0 inet static
>  address ...
>  network ...0
>  netmask 255.255.255.0
>
> auto eth1
> iface eth1 inet static
>  address ...
>  network ...0
>  netmask 255.255.255.0
>
> However my vm does manage to get an IP via dhcp so I can still log in.....
>
> It seems the vmcontext.sh script is not catching th IP variable correctly.
>
> Has anyone else come across this before ??
>
> Thanks!!
> Gavin
>



-- 
Javier Fontan, Grid & Virtualization Technology Engineer/Researcher
DSA Research Group: http://dsa-research.org
Globus GridWay Metascheduler: http://www.GridWay.org
OpenNebula Virtual Infrastructure Engine: http://www.OpenNebula.org


More information about the Users mailing list