hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.01k stars 4.42k forks source link

guest additions adding not respond for some VM #13372

Open SylvainArd opened 3 months ago

SylvainArd commented 3 months ago

Debug output

INFO interface: info: VirtualBox Guest Additions: NOTE: you may still consider to re-login if some user session specific services (Shared Clipboard, Drag and Drop, Seamless or Guest Screen Resize) were not restarted automatically

Expected behavior

The command does not return control to the command prompt.

Actual behavior

The command hangs with : INFO interface: info: VirtualBox Guest Additions: NOTE: you may still consider to re-login if some user session specific services (Shared Clipboard, Drag and Drop, Seamless or Guest Screen Resize) were not restarted automatically

Reproduction information

my command.bat is :

echo "pour installer le plugin des additions invies sur vagrant" vagrant plugin install vagrant-vbguest echo "creer les VM" vagrant up echo "redemarrage pour preparer les additions invites" vagrant reload
echo "installer les additions invites" vagrant vbguest --do install
echo "redemarrage pour installer les additions invites" vagrant reload

the cmd hangs in the command vagrant vbguest --do install at VM git_server, the same is for the three following VM

Vagrant version

2.4.1

Host operating system

Windows 10

Guest operating system

Debian 12

Steps to reproduce

  1. vagrant up
  2. vagrant reload
  3. vagrant vbguest --do install

Vagrantfile

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  # Plugin pour s'assurer que les additions invité sont à jour
  config.vbguest.auto_update = false

  # Configuration du Serveur Git
  config.vm.define "git_server" do |git_server|
    git_server.vm.box = "debian/bookworm64"
    git_server.vm.network "private_network", ip: "192.168.56.11"
    git_server.vm.provision "shell", inline: <<-SHELL
      sudo apt-get update
      sudo apt-get install -y build-essential dkms linux-headers-$(uname -r)
      sudo apt-get update

      DEBIAN_FRONTEND=noninteractive apt-get install -y console-setup keyboard-configuration
      # this is the trick, you have to change the default keyboard config before 
        # running dpkg-reconfigure or you will always end with what it is configured
        #  in /etc/default/keyboard, so for a french keyboard for example:
        echo '
        XKBMODEL="pc105"
        XKBLAYOUT="fr"
        XKBVARIANT=""
        XKBOPTIONS=""

        BACKSPACE="guess"
        ' > /etc/default/keyboard

        dpkg-reconfigure --frontend noninteractive keyboard-configuration
      sudo apt-get upgrade -y
      sudo apt-get install -y git-core
      # Ajout de l'utilisateur bbb
      sudo useradd -m bbb -s /bin/bash
      echo 'bbb:bbb' | sudo chpasswd
      echo 'bbb ALL=(ALL) NOPASSWD: ALL' | sudo tee -a /etc/sudoers
    SHELL
    git_server.vm.provider "virtualbox" do |vb|
      vb.memory = "1024"

    end
  end

  end
end
IskandarKurbonov commented 2 months ago

Use Ubuntu 22.04 as the guest OS