# xen 3.1.0 and Gentoo

## kox

Hi,

is somebody already using xen 3.1.0 on gentoo?

Is there ebuild available?

----------

## smoco

Yes I'm using it. It is working good (only that bnx2 module problem is there). There is no ebuid is yet. Use source package from xen site if you want it.

----------

## tokka

https://bugs.gentoo.org/show_bug.cgi?id=179412

----------

## tokka

Xen 3.1 built fine from that ebuild - though only with pae enabled - I don't have time at the moment as I have a working install, to look further into that.

----------

## smoco

When will be xen 3.1 in portage tree ?? I can help with ebuild contact me if it can help.

----------

## pent0z

working fine here

2.6.18 kernel

xen 3.1.0

running a dom0 plus

1 firewall and bridged vpn client domU with a network card exported with pciback

1 asterisk pbx domU with a TDM400 card with some FXS/FXO modules exported with pciback (for pstn lines)

1 primary domain controller domU with a Fritz Capi ISDN card exported with pciback (for receiving faxes with hylafax + faxcapi)

rock solid  :Smile: 

ps: seems that this release has support for framebuffer... when i boot the xen.gz, i see another resolution (however after init, it returns to standard console)

----------

## smoco

It looks that pciback is working really good  :Very Happy:  . I've tied ms windows as hvm a its working good, but sun solaris 11 (as hvm) freez.

----------

## tomekki

hello,

I tried to build Xen 3.1 as well and I got some trouble with it.

I followed the link posted by tokka and downloaded the Ebuilds and patches for xen-3.1.0.

Than, I preformed the command 'ebuild xen-sources-2.6.18.ebuild compile' which let me know that the file 'patch-2.6.18_to_xen-3.1.0.bz2' is missing.

So I downloaded the missing file (Patch vanilla kernel with xen) and placed it under /usr/portage/distfiles and tried again:

```

xen-sources # ebuild xen-sources-2.6.18.ebuild compile

Appending /opt to PORTDIR_OVERLAY...

!!! Previously fetched file: 'patch-2.6.18_to_xen-3.1.0.bz2'

!!! Reason: Filesize does not match record size 

!!! Got: 599343

!!! Expected: 598828

Refetching...

```

It Sees that the Manifest file is not fitting to the patch.

Can you give me advice how you managed to build Xen 3.1?

Thanks in in advanceLast edited by tomekki on Thu May 31, 2007 9:10 pm; edited 1 time in total

----------

## smoco

Hmm i've used xen 3.1 original source from xen site and it working perfectly.

----------

## tomekki

All right than, I'll try this. The ebuild version should be in the testing tree at some point ...

----------

## warrawarra

Not sure but will " etc-update " not relist / rebuild new files list in portage tree.

I saw a guide / how-to for XEN on sabayonlinux.org (gentoo) forums site made by davemc , might be of help.

Also trying to get Xen and windoze on top of Xen. First need to get i8kutils and missing i8k module to work to get laptop fans going before trying xen again. (2.6.21-rc2) 

Just hit a few snags with virtual machine or Xen management prog and setting the fake windows uplast time.   Used 3.04 and all seems a bit greek to me LOL.

----------

## zoltak

Hi Guys,

I tried 3.0.4 and 3.10. When booting into Xen it freezes when loading UDEV at the point where it populates /dev. I am running 2xQuad Core Xeons amd64 mode.

Do I need to compile with pae?

Or am I missing something  :Sad: . I compiled the kernel with PCI backend on dom0 and PCI frontend on domU. Not sure if this is causing it?

Any thoughts?

----------

## zoltak

To be more specific it happens at Letting udev process events. This is the point just before it loads the modules.

----------

## warrawarra

Any reason why you are not using x86-64 , not sure but amd64 might cause a few problems not sure here.

For the udev go into 2nd terminal "alt+f2" and root and type "dmesg" this will give you a idea what is happening if not able to I am not sure but there should be a log program ? syslog or vixie cron ? that will log all error's and this can possibly shed some light on the lockup.

Might be worthwhile looking into this.

Think there is a /etc/?? udev or something that can show you what loads and by trying to disable tehm one at a time and restarting you can also find the problem. This might be last option as it can cuase some crashes i would think.

Hopes this helps.

----------

## tokka

I'd stick to the ebuild as it is a known quantity

 *tomekki wrote:*   

> hello,
> 
> It Sees that the Manifest file is not fitting to the patch.
> 
> Can you give me advice how you managed to build Xen 3.1?
> ...

 

You need to recreate the Manifest file, simply go to the directory holding the ebuild, and then enter:

```

ebuild xen-sources-2.6.18.ebuild digest

```

Notes:

At the link above there are now updated ebuilds for xen and xen-tools, I've just tested both on a AMD AM2 box and they work fine, just made a HVM machine with Windows Server 2003r2. The only complication was that the HVM example in the Xen manual is out of date (cdrom="" is obsolete), to enable install from an ISO image the following works:

```

disk = [ 'phy:/dev/mtbvolume/w32,ioemu:hda,w', 'file:/tmp/WINDOWS_2003_STANDARD.ISO,hdc:cdrom,r' ]

```

PAE is only needed for a 32bit host install. Installing Xen with the ebuild on a 64bit machine running a 32bit install of Gentoo  needs you to use PAE at the moment due to an error.

If you are doing a Xen install for the first time and are having problems, to keep things simple do a 64bit gentoo 2007 install first and get a minimal gentoo-sources kernel running before attempting to install Xen - Xen drops in very cleanly.

----------

## tomekki

Thanks for your answer tokka.

Just in time, i had a hard time with the original sources anyway.   :Very Happy: 

I am going to recreate the Manifest tomorrow.

A marginal Question:

  I have a Core 2 Duo Processor with 4 GB of RAM. My system is build with 32 bit  (PAE). 

  Would it make sense to recompile my packages to get a 64 bit system before starting with Xen?

  When I remember right, Intel bought a license from AMD to use the AMD64 micro architecture in its processors as well.

  I am just not sure whether the difference between 32 and 64 bit (Intel/AMD) is so big in the end?

----------

## kox

I think its better option to use 64bit dom0 especialy because of memory management.

xen 3.1.0 when instaled in 64bit is able to run 32/64bit HVM guest and 32/64bit PV guest.

Only limiting condition is that 32bit PV guests have to use 32bit PAE enabled kernel.

----------

## tokka

 *kox wrote:*   

> I think its better option to use 64bit dom0 especialy because of memory management.
> 
> 

 

I won't argue with that:)

But there are a lot of people out there with x86 Gentoo installs on 64bit hardware, so if one of them currently wants to try the 3.1 ebuild they need to be aware that they need PAE.

----------

## tomekki

Hello again,

I got a 64 bit version of xen 3.1 running.    :Very Happy: 

Unfortunately Xen uses the kernel in version 2.6.18 and this version has some known issues with my on-board intel graphic hardware:

```

(EE) GARTInit: Unable to open /dev/agpgart (No such device)

```

I simply go the way of the least resistance and buy a new graphic card.

Thank you all for your support!

----------

## yesi

hi,

i've tried xen 3.1 also.

but it seem that i've have some problem with network: i can't have it.

i'm under the domain

without xen, the network works fine.

but with xen 3.1, i successed ping 172.20.2.160 (my xen station), but i can't ping the gateway 172.20.2.1

here's my netstat -nr

 *Quote:*   

> 
> 
> Destination       Passerelle       Genmask          Indic    MSS Fenêtre irtt Iface
> 
> 172.20.2.0         0.0.0.0             255.255.255.0     U           0 0            0 eth0
> ...

 

 *Quote:*   

> 
> 
> eth0      Lien encap:Ethernet  HWaddr 00:0F:FE:6B:57:32  
> 
>           inet adr:172.20.2.160  Bcast:172.20.2.255  Masque:255.255.255.0
> ...

 

what's about this?

did i forget something?

thank in advance.

----------

## nakun

Hello I am using a fresh install of gentoo 2007.0 and I wanted to use Xen 3.1.0 because I couldn't use GFS in Xen 3.0.4 kernel.

So I followed this post and finally I could install the 2.6.18-xen kernel and the xen-tools, but when I try to install xen 3.1.0 I get an error in the install step, ebuild xen-3.1.0.ebuild compile is OK but when I execute ebuild xen-3.1.0.ebuild merge

this error is showed:

make[3]: *** [/var/tmp/portage/app-emulation/xen-3.1.0/work/xen-3.1.0-src/xen/xen-syms] Error 1

make[3]: se sale del directorio `/var/tmp/portage/app-emulation/xen-3.1.0/work/xen-3.1.0-src/xen/arch/x86'

make[2]: *** [/var/tmp/portage/app-emulation/xen-3.1.0/work/xen-3.1.0-src/xen/xen] Error 2

make[2]: se sale del directorio `/var/tmp/portage/app-emulation/xen-3.1.0/work/xen-3.1.0-src/xen'

make[1]: *** [install] Error 2

make[1]: se sale del directorio `/var/tmp/portage/app-emulation/xen-3.1.0/work/xen-3.1.0-src/xen'

make: *** [install-xen] Error 2

!!! ERROR: app-emulation/xen-3.1.0 failed.

Call stack:

  ebuild.sh, line 1615:   Called dyn_install

  ebuild.sh, line 1061:   Called qa_call 'src_install'

  ebuild.sh, line 44:   Called src_install

  xen-3.1.0.ebuild, line 91:   Called die

Please could anyone help me?? I need Xen for my thesys   :Confused: 

----------

## draugen

nakun: you need to enable pae.

```
USE="PAE" emerge xen
```

I'm having some problems with Xen 3.1.0 on gentoo. I set it up using this howto

1) the xend init script does not autostart networking. all google/forum search comes up with is a problem whith the Broadcom NetExtreme2 NIC, which does not apply in my situation (i use the forcedeth driver). the virtual interfaces are created (vif0.0, peth0 etc) but i have not network connectivity. A manual /etc/init.d net.eth0 works. I have no idea if the bridge works after doing this.

 2) i'm having trouble compiling a valid domU kernel. I use the 2.6.18-xen kernel provided by mescalito's overlay (http://thestonertree.com/layman.txt). in my current config, subarch type is set to xen-compatible. this leads to xm -create returning

```
Error: (2, 'Invalid kernel', 'xc_dom_compat_check: guest type xen-3.0-x86_32 not supported by xen kernel, sorry')
```

setting subarch type to 'PC-Compatible' breaks the kernel compile.

Any thoughts?

----------

## nakun

Why I have to use PAE?? in my old gentoo 2006.1 with Xen 3.0.4 I donÂ´t enabled this use flag and itÂ´s works fine

With your network problem try to ignore this point in the manual "RC_PLUG_SERVICES="!net.*"" I had the same problem, if  you want network for Dom0 use "eth0" and If you need network for DomUs use vif<DomU ID.eth device>, vif<1.0> is Dom1 eth0

with kernel use the kernel at this post Ebuilds and patches for xen-3.1.0. https://bugs.gentoo.org/attachment.cgi?id=119984 but I advice you that xen 3.0.4 with this kernel is unestable (almost for me)

----------

## draugen

the kernel problem was solvable by using the same kernel source tree i'd used for dom0, for some reason.

and i got networking to work by adding net.eth0 to the default runlevel and leaving the RC_PLUG_SERVICES to "!net.*". with net.eth0 in runlevel default and RC_PLUG_SERVICES empty, eth0 would receive an IP address, bt the xend script would clobber up the routes.

And i do not know why the xen 3.1.0 ebuild only compiles with USE="pae". It makes errors go away, and i'm happy  :Smile: 

----------

## nakun

If I activate the USE PAE flag in /etc/make.conf, the ebuild compile and install fine, but when I try to boot with xen 3.1.0 I get a kernel panic because it said that this kernel is not a pae kernel.

I enabled the option " 64 bit memory and IO resources" in "PROCESSOR TYPE AND FEATURES" kernel option, this option enables PAE or I need other flag??

I am using the 2.6.18 kernel from this post

Any Idea??

----------

## manlydan

I have the "pae" USE flag set in /etc/make.conf and xen-3.1.0 emerged okay, but when I try to emerge xen-tools I get the following error:

../../tools/libxc/libxenctrl.so: undefined reference to `___tls_get_addr'

collect2: ld returned 1 exit status

make[1]: *** [xenstored] Error 1

make[1]: Leaving directory `/var/tmp/portage/app-emulation/xen-tools-3.1.0/work/xen-3.1.0-src/tools/xenstore'

make: *** [all] Error 2

make: Leaving directory `/var/tmp/portage/app-emulation/xen-tools-3.1.0/work/xen-3.1.0-src/tools'

!!! ERROR: app-emulation/xen-tools-3.1.0 failed.

Call stack:

  ebuild.sh, line 1614:   Called dyn_compile

  ebuild.sh, line 971:   Called qa_call 'src_compile'

  environment, line 3603:   Called src_compile

  xen-tools-3.1.0.ebuild, line 126:   Called die

Any ideas?

----------

## manlydan

 *Quote:*   

> If I activate the USE PAE flag in /etc/make.conf, the ebuild compile and install fine, but when I try to boot with xen 3.1.0 I get a kernel panic because it said that this kernel is not a pae kernel.
> 
> I enabled the option " 64 bit memory and IO resources" in "PROCESSOR TYPE AND FEATURES" kernel option, this option enables PAE or I need other flag??
> 
> I am using the 2.6.18 kernel from this post
> ...

 

Not sure if this'll help but take a look at http://kerneltrap.org/node/2450

From what I can tell, you need to enable high memory support for PAE. 

I'm not in a position to test this at the moment so I may very well be wrong about this   :Confused: 

----------

## nakun

Edit your /etc/make.conf and add '-mno-tls-direct-seg-refs' to your CFLAGS., you can see this in http://gentoo-wiki.com/HOWTO_Xen_and_Gentoo#TLS_and_CFLAGS

----------

## manlydan

Okay, I added that to make.conf and tried emerging again but unfortunately, I'm getting the same error.

I re-emerged xen just in case but it didn't help.

/etc/make.conf :

CFLAGS="-O2 -mtune=i686 -pipe -mno-tls-direct-seg-refs"

CHOST="i386-pc-linux-gnu"

CXXFLAGS="${CFLAGS}"

MAKEOPT="-j3"

GENTOO_MIRRORS="http://www.gtlib.gatech.edu/pub/gentoo " 

CONFIG_PROTECT="-*"

USE="-ipv6 pae nptonly sdl mysql apache apache2 ctype pcre unicode session gtk kde qt3 qt4 dvd dvdr alsa cdr"

VIDEO_CARDS="radeon"

----------

## nakun

you hava to recompile all the system with  emerge -evat world in order to all the system be compile without tls

----------

## nakun

Thanks manlydan I change HIGHMEM=4Gb option for HIGHMEM=64Gb option in kernel and all works fine, xen 3.1.0 boot and runs great, no problems   :Cool: 

----------

## manlydan

 *Quote:*   

> you hava to recompile all the system with emerge -evat world in order to all the system be compile without tls

 

I'll go and do that tomorrow and post back the results.

 *Quote:*   

> Thanks manlydan I change HIGHMEM=4Gb option for HIGHMEM=64Gb option in kernel and all works fine, xen 3.1.0 boot and runs great, no problems 

 

Glad I could help  :Smile: 

----------

## manlydan

Everything is installed now.  :Cool: 

Thanks for the help nakun.

----------

## olli.bo

Hi,

did you made any experience with vnc an xen 3.1? I can't get it working. 

We set vnc=1 in the vm-config and set (vnc-listen '0.0.0.0') in /etc/xen/xend-config.sxp as described in different howtos found with google...

thx 

olli

----------

