Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 May 2020 22:08:28 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 245051] Vagrant image for 12.1 can't start shell
Message-ID:  <bug-245051-227-1Lpbm3yWaZ@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-245051-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-245051-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D245051

John-Mark Gurney <jmg@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |Open
           Severity|Affects Only Me             |Affects Some People
                 CC|                            |jmg@FreeBSD.org

--- Comment #1 from John-Mark Gurney <jmg@FreeBSD.org> ---
I have been able to reproduce this.  This affects the following versions of
FreeBSD 11.3-R, 11.x-STABLE, 12.1-R, 13.0-CURRENT and likely effects all im=
ages
produced.

I have sent an email to re@ about this, but have not received a reply about
this.  Here is the email:
There is an issue where vagrant defaults to using bash to see if a VM
is running.  We do not install bash by default, and so that results in
the following experience:
nmac,ttys006,~/f114b,505$vagrant init freebsd/FreeBSD-11.4-BETA2
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
nmac,ttys006,~/f114b,506$vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
=3D=3D> default: Box 'freebsd/FreeBSD-11.4-BETA2' could not be found. Attem=
pting to
find and install...
    default: Box Provider: virtualbox
    default: Box Version: >=3D 0
=3D=3D> default: Loading metadata for box 'freebsd/FreeBSD-11.4-BETA2'
    default: URL: https://vagrantcloud.com/freebsd/FreeBSD-11.4-BETA2
=3D=3D> default: Adding box 'freebsd/FreeBSD-11.4-BETA2' (v2020.05.15) for
provider: virtualbox
    default: Downloading:
https://vagrantcloud.com/freebsd/boxes/FreeBSD-11.4-BETA2/versions/2020.05.=
15/providers/virtualbox.box
    default: Download redirected to host:
vagrantcloud-files-production.s3.amazonaws.com
=3D=3D> default: Successfully added box 'freebsd/FreeBSD-11.4-BETA2' (v2020=
.05.15)
for 'virtualbox'!
=3D=3D> default: Importing base box 'freebsd/FreeBSD-11.4-BETA2'...
=3D=3D> default: Generating MAC address for NAT networking...
=3D=3D> default: Checking if box 'freebsd/FreeBSD-11.4-BETA2' version '2020=
.05.15'
is up to date...
=3D=3D> default: Setting the name of the VM: f114b_default_1590096819756_45=
273
=3D=3D> default: Fixed port collision for 22 =3D> 2222. Now on port 2201.
=3D=3D> default: Clearing any previously set network interfaces...
=3D=3D> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
=3D=3D> default: Forwarding ports...
    default: 22 (guest) =3D> 2201 (host) (adapter 1)
=3D=3D> default: Booting VM...
=3D=3D> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2201
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
The configured shell (config.ssh.shell) is invalid and unable
to properly execute commands. The most common cause for this is
using a shell that is unavailable on the system. Please verify
you're using the full path to the shell and that the shell is
executable by the SSH user.

it also causes other things to happen.  I filed a bug w/ vagrant, and
they refused to fix it on their side of things (like doing the correct
posix way of using sh): https://github.com/hashicorp/vagrant/issues/11532

I have finally attempted the fix of providing a default Vagrantfile in
the box with a shell set of sh, and this fixed the error.  The file
contents were just:
Vagrant.configure("2") do |config|
        config.ssh.shell =3D "/bin/sh"
end

and the only requirements was that the file be located in the same
directory:
nmac,ttys006,~/f114b,545$tar -tzf shellfix.box
Vagrantfile
box.ovf
metadata.json
vagrant.vmdk

Otherwise everything else was the same.

and with that fix applied:
=3D=3D> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2201
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default:
    default: Vagrant insecure key detected. Vagrant will automatically repl=
ace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key=
...
=3D=3D> default: Machine booted and ready!
=3D=3D> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed vers=
ion
of
    default: VirtualBox! In most cases this is fine, but in rare cases it c=
an
    default: prevent things such as shared folders from working properly. If
you see
    default: shared folder errors, please make sure the guest additions wit=
hin
the
    default: virtual machine match the version of VirtualBox you have insta=
lled
on
    default: your host and reload your VM.
    default:
    default: Guest Additions Version: 5.2.34
    default: VirtualBox Version: 6.0
=3D=3D> default: Mounting shared folders...
    default: /vagrant =3D> /Users/jmg/f114b
Vagrant is not able to mount VirtualBox shared folders on BSD-based
guests. BSD-based guests do not support the VirtualBox filesystem at
this time.

To change the type of the default synced folder, specify the type as
rsync or nfs:

    config.vm.synced_folder ".", "/vagrant", type: "nfs" # or "rsync"

Alternatively, if you do not need to mount the default synced folder,
you can also disable it entirely:

    config.vm.synced_folder ".", "/vagrant", disabled: true

You can read more about Vagrant's synced folder types and the various
configuration options on the Vagrant website.

This is not a bug in Vagrant.


I have not dug into why it cannot mount /vagrant, but I do have some
work on getting this working on 13.0-CURRENT.

I do not have a good way to run through the release process to generate
a patch that would work, but I'm more than willing to test any box that
is created..  They can either be pushed to the vagrant cloud, or provide
me w/ a url, or even a location on the freebsd cluster that I scp down,
and I will quickly confirm if the fix works.

This affects all releases, not just 11.x, but 12.x and the 13.0
snapshots as well.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-245051-227-1Lpbm3yWaZ>