虚拟机vwmare ubuntu 18 重置密码

本文提供了一种简单的方法来解决Ubuntu 18.04中丢失root密码的问题,通过GRUB菜单编辑、进入单用户模式并重置密码,适用于物理机或虚拟机环境。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

网上有很多的我试了都不行,在外网找到一个资料,一次就可以了。

https://linuxconfig.org/how-to-reset-lost-root-password-on-ubuntu-18-04-bionic-beaver-linux

How to reset lost root password on Ubuntu 18.04 Bionic Beaver Linux

27 May 2020 by Lubos Rendek

Objective

The objective is to reset lost root or user password on Ubuntu 18.04 Bionic Beaver Linux.

Operating System and Software Versions

  • Operating System: – Ubuntu 18.04 Bionic Beaver

Requirements

Physical access to your computer or virtual machine with the Ubuntu 18.04 Bionic Beaver installation is required.

Conventions

  • # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Other Versions of this Tutorial

Ubuntu 20.04 (Focal Fossa)

Instructions

Boot Into GRUB menu

The first step is to reboot into the GRUB menu. If Ubuntu 18.04 Bionic Beaver is the only operating system installed you need to keep pressing SHIFT for the GRUB menu to show up.

Edit Grub Menu

Using arrows select the Ubuntu menu or the menu you use to boot your system and hit the e key. This will allow you to edit the menu:

Navigate down with the arrow-down key until you can see a line ending with:

ro   quiet splash $vt_handoff



Using your keyboard replace the following keywords.
FROM:

ro   quiet splash $vt_handoff

TO:

rw init=/bin/bash

Once you have made the change press F10 or CTRL + x to perform boot into a single mode.

Reset password

Confirm that your system partition is mounted as read/write (rw):

# mount | grep -w /

If all good, reset your root password with the passwd command:

# passwd

Alternatively, you can reset your user password. The following linux command will reset the password for the linuxconfig user:

# passwd linuxconfig


Reboot

Your root password is now reset. Reboot your system:

# exec /sbin/init

Troubleshooting

Enter new UNIX password:
Retype new UNIX password:
passwd: Authentication token manipulation error
passwd: password unchanged

Your root partition is mounted read-only. Try:

# mount -o remount,rw /

to resolve this issue.


[ end Kernel panic - not syncing: Attempted to kill init! exit code=0x0007f00

Make sure that you removed the splash boot option when editing the grub’s menu item.


When trying to reboot with the reboot command I get:

Failed to connect to bus: No such file or directory
Failed to talk to init daemon.

Ignore, and reboot with:

# exec /sbin/init
<think>好的,我需要帮助用户在Windows虚拟机中安装和配置VMware。首先,用户可能指的是在已有的Windows虚拟机里再安装VMware软件,比如VMware Workstation,以便创建嵌套虚拟化环境。不过,通常情况下,VMware作为宿主机软件,安装在物理机上,而不是虚拟机内部。但用户的需求可能是想实现嵌套虚拟化,即在虚拟机里运行VMware来创建更多虚拟机。 首先,我需要确认用户的具体需求。如果用户是想在Windows虚拟机中安装VMware Workstation,需要先检查宿主机和虚拟机的硬件是否支持嵌套虚拟化。例如,在VMware中,宿主机的虚拟化设置需要启用Intel VT-x或AMD-V,并且虚拟机的配置中也要开启嵌套虚拟化选项。不同虚拟机软件(如VMware、VirtualBox)的设置方法不同,需要具体指导。 接下来,安装步骤大致如下:首先确保宿主机允许嵌套虚拟化,然后在Windows虚拟机中下载并安装VMware Workstation。安装过程中可能需要注意权限问题,以及确保系统满足VMware的要求,比如Windows版本和硬件资源(CPU、内存)。安装完成后,可能还需要配置网络和存储设置,以便在嵌套的虚拟机中运行其他操作系统。 此外,用户可能需要安装VMware Tools来增强虚拟机性能,比如更好的图形支持和鼠标集成。虽然引用[2]提到的是在Windows Server 2019中安装VMware Tools,但同样适用于其他Windows版本。需要提醒用户注意快捷键切换的问题,避免输入冲突。 用户的问题可能涉及到的难点包括:正确启用嵌套虚拟化、资源分配是否足够、以及可能的兼容性问题。需要详细说明每一步的操作,并提供参考链接供用户查阅详细教程,如引用[1]中的安装Windows 11虚拟机步骤,虽然场景不同,但部分步骤类似,如新建虚拟机。 最后,生成相关问题需要考虑用户可能的后续疑问,比如性能优化、常见错误解决等。</think>### 在Windows虚拟机中安装和配置VMware的步骤 #### 1. **确认宿主机支持嵌套虚拟化** - **宿主机设置**:在物理机的BIOS中启用虚拟化技术(Intel VT-x或AMD-V)。 - **虚拟机设置**:在宿主机的VMware中,为Windows虚拟机开启嵌套虚拟化功能: - 关闭虚拟机 → 右键虚拟机 → 选择“编辑设置” → 找到“处理器”选项 → 勾选“虚拟化Intel VT-x/EPT或AMD-V/RVI”[^2]。 #### 2. **在Windows虚拟机中安装VMware Workstation** - **下载安装包**:从VMware官网下载Windows版Workstation安装程序。 - **安装步骤**: 1. 运行安装程序,按向导完成安装。 2. 安装需管理员权限,确保关闭杀毒软件避免冲突。 3. 安装完成后重启虚拟机。 #### 3. **配置VMware Tools(增强功能)** - **安装VMware Tools**: - 在VMware虚拟机菜单中,选择“虚拟机” → “安装VMware Tools”。 - 挂载工具镜像后,在Windows虚拟机中运行安装程序。 - **功能作用**:改善显示性能、支持拖放文件、调整分辨率等。 #### 4. **验证嵌套虚拟化** - 在Windows虚拟机中打开VMware Workstation,尝试新建一个嵌套的虚拟机(如Linux)。 - 分配足够资源(CPU核心、内存),例如至少2核CPU和4GB内存。 #### 5. **网络与存储配置** - **网络模式**:建议使用“NAT模式”或“桥接模式”使嵌套虚拟机可联网。 - **存储路径**:为嵌套虚拟机分配独立的磁盘空间,避免与宿主机冲突。 --- ### 注意事项 - **兼容性问题**:嵌套虚拟化对硬件和软件版本要求较高,需确保宿主机、虚拟机、VMware版本均支持。 - **性能影响**:嵌套虚拟化会显著增加资源消耗,建议宿主机配置较高(如多核CPU、大内存)。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值