Vagrant no logra abrir eth1 en el invitado Xubuntu 16.04

Vagrant no logra abrir eth1 en el invitado Xubuntu 16.04

Soy relativamente nuevo en Linux y Vagrant. Actualicé mi sistema invitado VM (VirtualBox 5.0.18 + Vagrant 1.8.1 en un host Windows) de Xubuntu 15.10 a Xubuntu 16.04 hace un tiempo. En ese momento o poco después noté algunas rarezas, por ejemplo, un cursor del mouse desalineado (con unos pocos píxeles de distancia) y directorios compartidos faltantes. Supongo que se debe al siguiente error informado durante vagrant up:

==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 8080 (guest) => 8080 (host) (adapter 1)
    default: 9000 (guest) => 9000 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
GuestAdditions 5.0.18 running --- OK.
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/sbin/ifup eth1

Stdout from the command:

Failed to bring up eth1.


Stderr from the command:

mesg: ttyname failed: Inappropriate ioctl for device
run-parts: /etc/network/if-up.d/ubuntu-fan exited with return code 1

Busqué el error en combinación con Vagrant y VirtualBox en línea, pero los casos que encontré parecían un poco diferentes al mío. La gente escribe sobre él /etc/udev/rules.d/70-persistent-net.rules, pero no parece existir en mi máquina, ni tampoco /etc/sysconfig.

Intentar ejecutar /sbin/ifup eth1para obtener más información después de iniciar sesión me da esto:

vagrant@IDE-machine ~ $ sudo /sbin/ifup -v eth1
Configuring interface eth1=eth1 (inet)
/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/bridge
run-parts: executing /etc/network/if-pre-up.d/ethtool
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
/bin/ip addr add 192.168.56.21/255.255.255.0 broadcast 192.168.56.255     dev eth1 label eth1
RTNETLINK answers: File exists
Failed to bring up eth1.

Mi archivo Vagrant se ve así:

Vagrant.configure(2) do |config|
  # a locally stored box
  config.vm.box = "IDE-machine"

  config.ssh.private_key_path = "ssh/id_rsa"

  config.vm.network "forwarded_port", guest: 8080, host: 8080
  config.vm.network "forwarded_port", guest: 9000, host: 9000

  config.vm.network "private_network", ip: "192.168.56.21"

  config.vm.provider "virtualbox" do |vb|
      vb.gui = true

      vb.memory = "12288"
      vb.cpus = 2
      vb.name = "my_IDE-machine"

      vb.customize ["modifyvm", :id, "--monitorcount", "1"]
      vb.customize ["modifyvm", :id, "--vram", "64"]
      vb.customize ["storageattach", :id, "--storagectl", "SATA", "--port", 1, "--device", 0, "--type", "hdd", "--medium", "V:/BoxStorage/Projects.vdi"]
  end
  config.vm.provision "shell", inline: "/vagrant/provision.sh"
end

Las adiciones de invitados están instaladas, uso el vagrant-vbguestcomplemento que había configurado anteriormente la versión correcta del complemento de invitado.

¿Alguien tiene una idea de cuál podría ser el problema o me da una pista sobre cómo puedo investigar más?

Actualizar: Me señalaron esto:https://github.com/mitchellh/vagrant/issues/7155(que no se aplica completamente a mi caso) Lo que me llevó a esto:https://askubuntu.com/questions/689070/network-interface-name-changes-after-update-to-15-10-udev-changes/732638#732638

Intenté cambiar /etc/default/grubcon GRUB_CMDLINE_LINUX="net.ifnames=0", luego update-grubcomo root y reiniciar, sin éxito.

Un poco más de husmeo me mostró esto:

vagrant@IDE-machine ~ $ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
auto eth1
iface eth1 inet static
      address 192.168.56.21
      netmask 255.255.255.0
#VAGRANT-END

Actualización 2:Como se solicita aquí está la salida de dmesg y el contenido de ubuntu-fan:

vagrant@IDE-machine ~ $ dmesg | grep eth
[    1.692133] e1000 0000:00:03.0 eth0: (PCI:33MHz:32-bit) 08:00:27:af:31:b4
[    1.692144] e1000 0000:00:03.0 eth0: Intel(R) PRO/1000 Network Connection
[    2.068113] e1000 0000:00:08.0 eth1: (PCI:33MHz:32-bit) 08:00:27:94:1e:dc
[    2.068120] e1000 0000:00:08.0 eth1: Intel(R) PRO/1000 Network Connection
[    5.732516] e1000: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
[    5.732980] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[    5.733061] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[    6.790923] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    6.793512] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    6.795646] e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
[    6.796069] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

vagrant@IDE-machine ~ $ cat /etc/network/if-up.d/ubuntu-fan 
#!/bin/sh

set -e

case "$IFACE" in
lo) exit 0 ;;
fan-*)  exit 0 ;;
esac

case "$ADDRFAM" in
inet) ;;
*) exit 0 ;;
esac

# NOTE: NetworkManager simply does not call out to the normal
#       down hooks as it only checks _after_ the interface has
#       been lost.  Roll with this.
case "$PHASE::$METHOD" in
post-up::static|post-up::dhcp|post-up::NetworkManager)          ;;
pre-down::static|pre-down::dhcp|post-down::NetworkManager)      ;;
*) exit 0 ;;
esac

case "$MODE" in
start|stop) ;;
*) exit 0 ;;
esac

/usr/sbin/fanctl net "$MODE" "$IFACE"

Respuesta1

¿Revisaste tus /etc/network/interfacesarchivos de configuración? Tal vez tengas varias puertas de enlace como se indicaaquí.

De todos modos, modificar un poco ese archivo y jugar con él ifconfigpuede ayudarte a solucionar el problema. Comprueba los permisos también, dudo que venga de ahí pero aún así :/

Puedes intentar volver a una configuración más simple si /etc/network/interfacesaún no es el caso y volver poco a poco al archivo de configuración original. Yo haría eso, creo.

EDITAR: Según su dmesgresultado, parece que los enlaces están listos, por lo que la parte de la red debería estar bien. Si lo hace dmesg | grep eth, ¿hay alguna información relevante?

Además, ¿puedes ser gato /etc/network/if-up.d/ubuntu-fan? Salió con el código de salida 1, podría ser interesante comprobar qué está pasando allí.

ACTUALIZAR:

Su dmesgresultado parece estar bien, los enlaces eth0/1 están listos al final, por lo que la red debería estar funcionando.

Debería intentar ejecutar el ubuntu-fanscript línea por línea y verificar los códigos de salida ( echo $?, debería ser 0). Me pregunto si el problema no viene del fanctlprograma al final. Normalmente se usa para controlar los ventiladores de una máquina, pero aquí es una VM, así que... Si proviene de esta línea, puedes intentar ver por qué está fallando, pero yo eliminaría la fanctllínea, y luego tal vez todo el archivo en hecho. Supongo que las otras líneas están aquí para manejar los eventos que se desencadenarán fanctl.

Revisé mis máquinas virtuales vagabundas (aunque principalmente Ubuntu 14.04) y no veo ninguna fanctlpor ninguna parte... No estoy seguro de que tenga sentido intentar controlar los ventiladores dentro de una máquina virtual.

información relacionada