I am using Vagrant to create a Linux VM on my Mac (Catalina). I want to access the physical serial port (connecting to a device) on my Mac from the VM, so I add the following settings to my Vagrantfile:
vb.customize ["modifyvm", :id, "--uart1", "0x3f8", "4"] vb.customize ["modifyvm", :id, "--uartmode1", "server", "/tmp/my_tty"]
But now I am always getting the timeout error below when starting my Vagrant box (with the “Vagrant up” command). Does anyone know what I am doing wrong here? What is the correct way to forward the serial port from the host (Mac) machine to the VM so the VM can detect & communicate to my device?
Loaded configured gateway IP: 192.168.1.1 over interface en0: Wi-Fi (AirPort)
Bringing machine ‘default’ up with ‘virtualbox’ provider…
==> default: Importing base box ‘ubuntu/xenial64’…
==> default: Matching MAC address for NAT networking…
==> default: Checking if box ‘ubuntu/xenial64’ version ‘20191113.0.0’ is up to date…
==> default: A newer version of the box ‘ubuntu/xenial64’ for provider ‘virtualbox’ is
==> default: available! You currently have version ‘20191113.0.0’. The latest is version
==> default: ‘20210316.0.0’. Run
vagrant box update to update.
==> default: Setting the name of the VM: player_control_server_default_1616299781589_50954
==> default: Clearing any previously set network interfaces…
==> default: Preparing network interfaces based on configuration…
default: Adapter 1: nat
default: Adapter 2: bridged
==> default: Forwarding ports…
default: 5000 (guest) => 5000 (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
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured (“config.vm.boot_timeout” value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you’re using a custom box, make sure that networking is properly
working and you’re able to connect to the machine. It is a common
problem that networking isn’t setup properly in these boxes.
Verify that authentication configurations are also setup properly,
If the box appears to be booting properly, you may want to increase
the timeout (“config.vm.boot_timeout”) value.