Port-xen archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: XEN v4.1.2 network troubles

On Sat, 22 Sep 2012 08:56:03 +0200
Ib-Michael Martinsen <i.m.martinsen%gmail.com@localhost> wrote:

> To run an unprivileged domain (DomU) I first copied
> cp /usr/pkg/share/examples/rc.d/xen{-watchdog,commons,d,domains} /etc/rc.d/
> and set
> xenwatchdog=YES
> xencommons=YES
> xend=YES
> xendomains=YES
> (I found no mentioning of the above copying and variable setting but I
> guess it is the common way to do it?)

Setting xend to YES is enough. You can find out the right varname with
the rcvar command; i.e.:

inflamm:29:~$ /etc/rc.d/xencommons rcvar                                       
# xencommons

> I managed to get a domU NetBSD domain to run by using the nbsd
> configuration file in the Howto documentation, but I had to comment out
> # nics = 1
> otherwise I get the messages:
> root%asus.immnet.dk@localhost:/root # xm create -c /usr/pkg/etc/xen/nbsd
> Using config file /usr/pkg/etc/xen/nbsd.
> Warning: The nics option is deprecated.  Please use an empty vif entry 
> instead:
>   vif = [ '' ]

Hmm. It seems the xmconfig.cfg man page is not up-to-date, then. It
also has @XENDCONFDIR@ unexpanded.

> Could someone tell me where to get a working copy of the network-bridge
> script?

It should have been installed under /usr/pkg/etc/xen/scripts/. If it hasn't, ot 
it doesn't work, the latest version should also be under 

> When starting a domU with network configuration (or any other VIF settings)
> vif = [ 'mac=aa:00:00:50:02:f0, bridge=bridge0' ]
> the domU start, waits approximately 100 seconds and then terminates with
> the messages:
> root%asus.immnet.dk@localhost:/root # xm create -c /usr/pkg/etc/xen/nbsd
> Using config file "/usr/pkg/etc/xen/nbsd".
> root%asus.immnet.dk@localhost:/root # Error: Device 0 (vif) could not be 
> connected. Hotplug scripts not working

I think you also need to set script in your vif entry; i.e. 
vif = [ 'mac=aa:00:00:50:02:f0, bridge=bridge0, script=vif-bridge' ]

If it still doesn't work, you can debug by adding logger commands to
the vif-bridge script to see whether it's called and what it's (not) doing.

> If I start domU without any VIF definitions and manually executes the 
> following
> commands on dom0
> root%asus.immnet.dk@localhost:/root # ifconfig bridge0 create
> root%asus.immnet.dk@localhost:/root # brconfig bridge0 add re0 up
> root%asus.immnet.dk@localhost:/root # xm network-attach nbsd 
> mac=12:34:56:78:90:12 bridge=bridge0 ip= &
> (parameters type, rate, model and accel can also be specified, but I am not 
> sure what to enter.
> Where do I find an explanation of these parameters?)
> a virtual interface is created on dom0 with the name xvif<domainId>i<n>, but 
> only for about
> 100 seconds. Furthermore the IP address does not seem to be assigned to 
> neither the dom0 VIF,
> the dom0 bridge nor the domU xennet0 VIF.
> While the dom0 VIF is exisiting, I can add it to the bridge on dom0:
> root%asus.immnet.dk@localhost:/root # brconfig bridge0 add xvif11i4 up
> and on domU I can assign VIF xennet0 an IP address and a default route:
> root%nbsd.immnet.dk@localhost:/root # ifconfig xennet0 inet
> root%nbsd.immnet.dk@localhost:/root # route add -net default
> (If I am fast enough) I can then ping on domU but not any 
> addresses
> on dom0 (e.g. the default gateway (, the dom0 ( 
> which as
> I understand should be available via the bridge.
> After approximately 100 seconds the VIF is destroyed on dom0 and xennet0 
> becomes
> unavailable on domU.

I never hotplugged devices like this, so I can't help much there. But
I'd guess you als need to specify the script on the command line.

kind regards

> Kind regards
>   Ib-Michael

Home | Main Index | Thread Index | Old Index