Ubuntu virtual machine very slow boot time
from the comments...
Edit your question to include the terminal output of sudo blkid
and cat /etc/fstab
and free -h
and swapon
.
Edit /etc/fstab
to make the UUID match the one from blkid.
sudo -H gedit /etc/fstab
Change this:
UUID=0dd5... none swap sw 0 0
To this:
UUID=6696... none swap sw 0 0
Then:
sudo swapon -a
# to turn on swap
free -h
# to see memory and swap
sudo swapon
# to see swap partition info
Related videos on Youtube
David Anekstein
Updated on September 18, 2022Comments
-
David Anekstein over 1 year
I have a VM running Ubuntu 16.04 on a Windows 7 host. It used to start up very quickly, but ever since I re-partitioned the disk to allow for more space using GParted, it takes about a minute to get to the login screen once I start the vm from virtual box. I have given a large amount of swap space.
In my Virtual Box settings under Storage > Controller: IDE the disk is currently marked 'Empty', but all my data loads just fine when it does eventually boot. If I change this .iso to the ubuntu.iso, it is then that I do not have my data available. What else can I do to diagnose the problem / does anyone know what can be done?
$ sudo blkid /dev/sda1: UUID="8563..." TYPE="ext4" PARTUUID="938..-01" /dev/sda5: UUID="6696..." TYPE="swap" PARTUUID="938..-05"
$ cat /etc/fstab <file system><mount point> <type> <options> <dump> <pass> / was on /dev/sda1 during installation UUID="8563..." / ext4 errors=remount-ro 0 1 swap was on /dev/sda5 during installation UUID="0dd5..." none swap sw 0 0
$free -h total used free shared buff/cache available Mem: 9.8G 1.4G 3.6G 42M 4.8G 8.0G Swap: 0B 0B 0B
$ swapon $
-
David Anekstein almost 7 years1000 thank you's for this @heynnema. How can this be prevented when partitioning in the future?
-
Boris Hamanov almost 7 years@DavidAnekstein just remember that if you delete/recreate your swap partition, that the UUID will change, and you must edit /etc/fstab.