Zend certified PHP/Magento developer

Restart VM during provisioning in vagrantfile

I’m trying to restart my VM during provisioning so that the change is taken into effect, I’ve tried using
config.vm.provision :reload and config.vm.provision "shell", reboot : true the VM restarts fine i can connect with ssh but vagrant doesn’t detect the reboot.

==> server: Attempting graceful shutdown of VM...
==> server: Checking if box 'ubuntu/bionic64' version '20221207.0.0' is up to date...
==> server: Clearing any previously set forwarded ports...
==> server: Clearing any previously set network interfaces...
==> server: Preparing network interfaces based on configuration...
    server: Adapter 1: nat
    server: Adapter 2: hostonly
==> server: Forwarding ports...
    server: 22 (guest) => 2222 (host) (adapter 1)
==> server: Running 'pre-boot' VM customizations...
==> server: Booting VM...
==> server: Waiting for machine to boot. This may take a few minutes...```

Ubuntu 18.04 LTS