mount shared directory
$ sudo apt-get update
2) install virtual box guest additions (referenced from here)
$ sudo apt-get install virtualbox-guest-additions-iso
3) Now install guest additional package (Crucial step! People generally miss this which creates an error “Unknown file type “vboxsf”)
$ apt-get install virtualbox-guest-utils
NOTES:
You might face the following problems:
No such device:
root@packer-virtualbox-iso:~/new# mount -t vboxsf new ~/new
/sbin/mount.vboxsf: mounting failed with the error: No such device
-> YOU HAVE TO RESTART TO ALLOW CHANGES TO TAKE EFFECT.
you might experience the following error:
vagrant@packer-virtualbox-iso:~$ sudo mount -t vboxsf new ~/new
/sbin/mount.vboxsf: mounting failed with the error: Protocol error
-> TO RESOLVE THIS, YOU MIGHT HAVE TO CHANGE THE NAME OF THE MOUNTING DEVICE/FOLDER (e.g. here is new)
扩展硬盘
现在virtualbox全局硬盘管理中增加硬盘大小。
然后进入虚拟机ubuntu系统安装gparted:sudo apt install gparted
运行:
先"swap off"关闭交换空间,然后删除linux-swap,删除extended。然后选择需要调整的盘执行"Resize/Move"命令,调整到需要的大小,同样留下4GB的空间再新建回extended与linux-swap,完成后点对勾应用更改,Partition节下会恢复原来的分区标识,修改完毕再正常进入系统即可。