Vagrant package login issues

Hello,

I’m currently trying to create a custom debian 10 box with VirtualBox 6.0 for vagrant 2.2.3 on my debian 10.

I’ve created a virtual machine in virtualbox, with debian 10 installed and mate desktop.
I’ve configured the user ‘vagrant’ with password ‘vagrant’, sudoers with no password for sudo.
The root password is also ‘vagrant’. I followed the documentation for the ssh tweaks with UseDNS set to no, and added the insecure public key with the correct rights.

When my virtualbox has booted, I tried to ssh on it using the private key, and it worked fine without password.

I packaged the box with vagrant package --base deb10, and created a simple VagrantFile for this using vagrant init package.box, everything went well.

But when I try to vagrant up, I have the following error :

vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'package.box'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: test_default_1652177221049_27993
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> 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: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...

I set the vb.gui = true in order to try and debug it, but when it boots up to the connection screen, I cannot log in using ‘vagrant’ ‘vagrant’ login and password. I tried in the tty also to log in as root with vagrant password and it also fails with wrong password, even if in the base virtual machine it worked.

I read some of topics here and there on internet and tried different options, setting the config.vm.base_mac or config.ssh.insert_key = false, doing a vagrant destroy && vagrant up each time but it didn’t helped.

Does anyone have an idea ?