# Gentoo as guest OS on Hyper-V Server

## ansmwke

I have a gentoo virtual machine running on VMWare Server and it works fine. We are migrating to our new hyper-v server. I took the vmdk file and converted it to a vhd and setup the VM in hyper-v. It runs but will not detect the network card. I have tried both the network adapters in hyper-v (regular and legacy) and neither work. 

here are the errors:

Starting eth0

bringing up eth0

172.25.1.19

network interface eth0 does not exist

please verify hardware or kernel module (driver)

ERROR: problem starting needed service net.eth0

netmount was not started

can anyone help me with this issue?

thanks!

----------

## BradN

Has the device showed up perhaps as eth1?

Check dmesg output and see if that says anything about network devices being found, etc.

----------

## ansmwke

i didnt see anything in dmesg that showed eth0 or eth1

----------

## gentoo_dude

what is the output for /sbin/ifconfig -a ?

----------

## ansmwke

output just shows the loopback adapter

----------

## Jaglover

Probably you have a custom kernel (not that unusual with Gentoo). It had support for VMWare virtual NIC, now you need to rebuild the kernel to include support for new virtual device.

----------

## ansmwke

is this something that is difficult to do? this gentoo machine was built prior to me being hired at work

----------

## Jaglover

Rebuilding the kernel was historically one of primary skills of any *nix admin. Nowadays we have Red Hat and Ubuntu and things are quite different. Since you ask ...

http://www.gentoo.org/doc/en/articles/linux-kernel-compiling.xml

----------

## gentoo_dude

look at your network device type: /sbin/lspci.  this way you know why network card to build your module for.  Also check /lib/modules/$kernel-version/drivers/net and see what network drivers you have already modules for.  I know that the VMware you can specify the network card in the vmx config file for the virtual machine:  eth0.virtualdev=e1000 (to force the virtual adapter to be identified as an Intel Pro 1000 nic).

Probably when you converted your virtual machine the NIC was reset to the original configuration pcnet.

----------

## minimaul

I have a Gentoo-based VM running well under Hyper-V.

Hyper-V's Legacy Adapter is a DECchip "Tulip" dc2114x, and it's pretty slow - this is only meant to be used until you can setup the drivers for the normal network adapter.

The normal drivers are under Staging drivers on all recent linux kernels - called the Microsoft Hyper-V client drivers - enable all of them for accelerated disk IO and network IO.

----------

## ansmwke

ok, i figured out how to get get into make menuconfig, how would i add the hyperv network driver?

thanks

----------

## ansmwke

the Network Controller is DECchip 21140 [FasterNet] (rev 20)

i ran make menuconfig and added the Tulip DECchip Tulip dc2114x PCI Support as 'built-in" and also tried it as a "module".

then i ran make and rebooted

The network card still doesnt work. am i missing something?

----------

## cach0rr0

 *ansmwke wrote:*   

> 
> 
> The network card still doesnt work. am i missing something?

 

ditch the Tulip quest for the time being

as one poster above noted:

 *Quote:*   

> 
> 
> The normal drivers are under Staging drivers on all recent linux kernels - called the Microsoft Hyper-V client drivers - enable all of them for accelerated disk IO and network IO.

 

Enable these, rebuild and reinstall your kernel. 

Then delete /etc/udev/rules.d/70-persistent-net.rules and reboot

If the module/driver is loaded, you should be able to see your card if you cat /proc/net/dev

and set it up as per usual

----------

## ansmwke

I don't see any Hyper-V drivers under Device Drivers - Staging Drivers. I actually don't even have staging drivers. I am running kernel v.2.6.17-gentoo-r8

----------

## DaggyStyle

 *ansmwke wrote:*   

> I don't see any Hyper-V drivers under Device Drivers - Staging Drivers. I actually don't even have staging drivers. I am running kernel v.2.6.17-gentoo-r8

 

2.6.17??????? have you considered trying a more recent and supported kernel?

----------

## ansmwke

I thought about upgrading the kernel, but I am unsure if that would change any of the setup that is there. we use the machine for simpleasset, apache, wordpress, mantis and wiki

is this the best instructions for upgrading the kernel?

http://www.gentoo.org/doc/en/kernel-upgrade.xml

----------

## DaggyStyle

 *ansmwke wrote:*   

> I thought about upgrading the kernel, but I am unsure if that would change any of the setup that is there. we use the machine for simpleasset, apache, wordpress, mantis and wiki
> 
> is this the best instructions for upgrading the kernel?
> 
> http://www.gentoo.org/doc/en/kernel-upgrade.xml

 

newer kernel means better hardware support and more secure usually.

that guide is ok.

----------

## ansmwke

linux-2.6.22-gentoo-r5 shows as the latest kernel. do you know if thats correct?

----------

## DaggyStyle

 *ansmwke wrote:*   

> linux-2.6.22-gentoo-r5 shows as the latest kernel. do you know if thats correct?

 

```
[I] sys-kernel/gentoo-sources

     Available versions:  

        (2.6.16-r13)    2.6.16-r13!b!s

        (2.6.32-r24)    2.6.32-r24!b!s

        (2.6.32-r29)    2.6.32-r29!b!s

        (2.6.35-r15)    2.6.35-r15!b!s

        (2.6.36-r8)     2.6.36-r8!b!s

        (2.6.37-r3)     (~)2.6.37-r3!b!s

        (2.6.37-r4)     2.6.37-r4!b!s

        (2.6.38)        (~)2.6.38!b!s

        (2.6.38-r1)     (~)2.6.38-r1!b!s

        (2.6.38-r2)     (~)2.6.38-r2!b!s

        (2.6.38-r3)     (~)2.6.38-r3!b!s

        {build deblob symlink ultra1}

     Installed versions:  2.6.38-r3(2.6.38-r3)!b!s(10:30:13 AM 04/23/2011)(-build -deblob -symlink)

     Homepage:            http://dev.gentoo.org/~mpagano/genpatches

```

you are seriously outdated.

is it a install cd? if not run emerge --sync

----------

## ansmwke

This is just a virtual machine. an old one. that hasnt been updated by the previous network admins at my work. I never knew they were so outdated until i was given the task of migrating the machine from vmware to a new box with hyperv. so forgive me with my lack of linux knowledge 

ran the command and this was the output at the end:

>>> Updating Portage cache:      

Invalid ebuild name: /usr/portage/app-admin/389-admin-console/389-admin-console-1.1.5.ebuild

Invalid ebuild name: /usr/portage/app-admin/389-admin-console/389-admin-console-1.1.4-r1.ebuild

Invalid ebuild name: /usr/portage/app-admin/389-console/389-console-1.1.6.ebuild

Invalid ebuild name: /usr/portage/app-admin/389-ds-console/389-ds-console-1.2.3-r1.ebuild

23%

Invalid ebuild name: /usr/portage/dev-libs/389-adminutil/389-adminutil-1.1.13.ebuild

Invalid ebuild name: /usr/portage/dev-libs/389-adminutil/389-adminutil-1.1.10.ebuild

50%

Invalid ebuild name: /usr/portage/games-rpg/eschalon-book-1-demo/eschalon-book-1-demo-105.ebuild

Invalid ebuild name: /usr/portage/games-rpg/eschalon-book-1-demo/eschalon-book-1-demo-106.ebuild

74%

Invalid ebuild name: /usr/portage/net-nds/389-admin/389-admin-1.1.11_rc1-r1.ebuild

Invalid ebuild name: /usr/portage/net-nds/389-admin/389-admin-1.1.13.ebuild

Invalid ebuild name: /usr/portage/net-nds/389-ds-base/389-ds-base-1.2.7.5.ebuild

Invalid ebuild name: /usr/portage/net-nds/389-ds-base/389-ds-base-1.2.6-r2.ebuild

91%

Invalid ebuild name: /usr/portage/www-apps/389-dsgw/389-dsgw-1.1.6.ebuild

Invalid ebuild name: /usr/portage/www-apps/389-dsgw/389-dsgw-1.1.5.ebuild

100%

* An update to portage is available. It is _highly_ recommended

 * that you update portage now, before any other packages are updated.

 * To update portage, run 'emerge portage' now.

blogs # emerge portage

Calculating dependencies -

!!! All ebuilds that could satisfy ">=app-admin/eselect-python-20091230" have been masked.

!!! One of the following masked packages is required to complete your request:

- app-admin/eselect-python-20100321 (masked by: required EAPI 1, supported EAPI 0)

- app-admin/eselect-python-20091230 (masked by: required EAPI 1, supported EAPI 0)

- app-admin/eselect-python-99999999 (masked by: required EAPI 2, supported EAPI 0)

For more information, see MASKED PACKAGES section in the emerge man page or 

refer to the Gentoo Handbook.

(dependency required by "sys-apps/portage-2.1.6.7" [ebuild])

----------

## DaggyStyle

please post the output of emerge --info here

----------

## ansmwke

blogs ~ # emerge --info

Portage 2.1.3.9 (selinux/2007.0/x86, gcc-4.1.1, glibc-2.4-r3, 2.6.17-gentoo-r8 i686)

=================================================================

System uname: 2.6.17-gentoo-r8 i686 Intel(R) Xeon(R) CPU E5335 @ 2.00GHz

Timestamp of tree: Mon, 25 Apr 2011 19:00:01 +0000

app-shells/bash:     3.2_p17

dev-lang/python:     2.4.3-r1

sys-apps/baselayout: 1.12.1

sys-apps/sandbox:    1.2.17

sys-devel/autoconf:  2.13, 2.61-r1

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.16.1-r3

sys-devel/gcc:       4.1.1

sys-devel/gcc-config: 1.3.13-r3

sys-devel/libtool:   1.5.22

sys-devel/make:      3.80-r4

sys-kernel/linux-headers: 2.6.11-r2

virtual/os-headers:  2.6.11-r2

ACCEPT_KEYWORDS="x86"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=i686 -pipe"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc"

CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/terminfo"

CXXFLAGS="-O2 -march=i686 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="distlocks loadpolicy metadata-transfer sandbox selinux sesandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="   http://gentoo.chem.wisc.edu/gentoo/ http://cudlug.cudenver.edu/gentoo/ http://gentoo.mirrors.pair.com/ http://gentoo.mirrors.tds.net/gentoo http://gentoo.netnitco.net http://mirror.espri.arizona.edu/gentoo/ http://mirrors.acm.cs.rpi.edu/gentoo/ http://gentoo.llarian.net/ http://mirror.datapipe.net/gentoo http://gentoo.cs.lewisu.edu/gentoo/ http://prometheus.cs.wmich.edu/gentoo http://mirror.usu.edu/mirrors/gentoo/ http://mirror.phy.olemiss.edu/mirror/gentoo http://mirror.mcs.anl.gov/pub/gentoo/ http://gentoo.cites.uiuc.edu/pub/gentoo/ http://mirror.clarkson.edu/pub/distributions/gentoo/ http://www.las.ic.unicamp.br/pub/gentoo/"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="3dnowex aac aalib acpi adns alsa apache2 berkdb cli cracklib crypt ctype cxx dri fortran iconv imagemagick mcal modules mudflap mysql ncurses nls openmp pam pcre perl php pppd python readline samba selinux session ssl swat symlink tcpd unicode x86 xml2 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

----------

