this is probably due to the vm syncing it's clock with host hardware, and running into problems. time sync is an ongoing virtualization issue. the fix here is to just disable guest sync with the host clock:
vboxmanage setextradata "vm name" "vboxinternal/devices/vmmdev/0/config/gethosttimedisabled" 1
NOTE: uses centos stream
be sure to enable the network interface via the anaconda installer gui.
- update packages on the guest:
sudo su - dnf update shutdown -r now
- install guest additions on the guest:
sudo su - mkdir /media/VirtualBoxGuestAdditions mount -r /dev/cdrom /media/VirtualBoxGuestAdditions/ dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm dnf install -y gcc kernel-devel kernel-headers dkms make bzip2 perl KERN_DIR=/usr/src/kernels/`uname -r` export KERN_DIR cd /media/VirtualBoxGuestAdditions/ ./VBoxLinuxAdditions.run exit
- shutdown the guest.
- configure core usage for guest on host via virtualbox ui.
- configure bridged networking for guest on host via virtualbox ui.
- boot guest and use virtualbox ui on host to configure shared folder.
- add guest shell user to
vboxsf
user and logout, then login. - create
~/.ssh/authorized_keys
on the guest. - use shared folder to copy local public ssh key from host to guest.
- cat public ssh key from shared folder to
~/.ssh/authorized_keys
. - run
chmod -R go= ~/.ssh
on the guest to correct permissions. - run
VBoxManage guestproperty get <vm-name> "/VirtualBox/GuestInfo/Net/0/V4/IP" | cut -f2 -d " "
on the host to get the guest's IP. - test ssh access from host to guest.