下面总结一下我通过Vagrant启动Ubuntu失败的解决方法,更多的技术文章,请参考我的学习笔记www.0101.vip。
1 定位问题
通过Vagrant使用VirtualBox启动Ubuntu失败的解决方法,首先,要确定是什么原因导致Ubuntu启动失败。调试的方法有2种:
1) 打开VirtualBox的图形化界面,需要打开Vagrantfile配置文件的图形显示选项
config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
end
看看图形化界面的报错提示是什么。建议首先使用这种方法来定位问题
2) 使用下面的命令来启动vagrant
vagrant up --debug
看看运行命令时报什么错
通过输入vagrant help,可以查看vagrant 的各种命令参数,详细如下
$ vagrant help
Usage: vagrant [options] <command> [<args>]
-h, --help Print this help.
Common commands:
box manages boxes: installation, removal, etc.
cloud manages everything related to Vagrant Cloud
destroy stops and deletes all traces of the vagrant machine
global-status outputs status Vagrant environments for this user
halt stops the vagrant machine
help shows the help for a subcommand
init initializes a new Vagrant environment by creating a Vagrantfile
login
package packages a running vagrant environment into a box
plugin manages plugins: install, uninstall, update, etc.
port displays information about guest port mappings
powershell connects to machine via powershell remoting
provision provisions the vagrant machine
push deploys code in this environment to a configured destination
rdp connects to machine via RDP
reload restarts vagrant machine, loads new Vagrantfile configuration
resume resume a suspended vagrant machine
snapshot manages snapshots: saving, restoring, etc.
ssh connects to machine via SSH
ssh-config outputs OpenSSH valid configuration to connect to the machine
status outputs status of the vagrant machine
suspend suspends the machine
up starts and provisions the vagrant environment
upload upload to machine via communicator
validate validates the Vagrantfile
version prints current and latest Vagrant version
winrm executes commands on a machine via WinRM
winrm-config outputs WinRM configuration to connect to the machine
For help on any individual command run `vagrant COMMAND -h`
Additional subcommands are available, but are either more advanced
or not commonly used. To see all subcommands, run the command
`vagrant list-commands`.
--[no-]color Enable or disable color output
--machine-readable Enable machine readable output
-v, --version Display Vagrant version
--debug Enable debug output
--timestamp Enable timestamps on log output
--debug-timestamp Enable debug output with timestamps
--no-tty Enable non-interactive output
2 Ubuntu启动失败各种问题的解决方法
下面是一些可能造成Ubuntu启动失败的原因:
1) /boot 磁盘满了
解决方法:删掉一些没用的文件,包括旧版本的系统文件
可以参考这篇
https://blog.youkuaiyun.com/weixin_37272286/article/details/79897636
2) 磁盘有逻辑损坏
比如提示某个目录需要作磁盘检测修复,如提示 /dev/sda1需要作磁盘检测修复,则运行下面的命令
fsck /dev/sda1 -y
记得加上 -y 参数,否则需要你手动确认是否修复每处逻辑损坏
------------------------------------------------------------------------------
我的公众号:区块链战斗机
我的知乎:powervip - 知乎
我的csdn:https://blog.youkuaiyun.com/powervip
我的github:https://powervip.github.io/
我的学习笔记:www.0101.vip
如果你觉得这篇文章写得还可以,请帮忙点个赞,谢谢!著作权归作者所有。如需转载,请注明原文出处并保留原文链接。
你的鼓励,我的动力!
347

被折叠的 条评论
为什么被折叠?



