Score:2

How do I gain admin access without a root password and no sudoers?

lb flag

I am running VirtualBox on a Windows Machine, and installed Ubuntu Linux 22.04 LTS. During the install, I set up the initial user. However, there appears to be no way to make this user have admin (sudo) privileges. After the install, I can login as the user, but I can't do anything involving admin (meaning, I can't use sudo). If there is a root password, I don't know what it is. (I think by default there is no password for root.)

I tried doing the trick where you run in recovery mode to run as root...but even then it prompts me for a root password, so I can't do anything.

I did the entire install process a second time, thinking I missed something, but to no avail.

Any advice on how to determine what the root password is when you install using VirtualBox? Or how to create a user that ends up in sudoers?

ru flag
If you install using VirtualBox, there is no root password, you use `sudo` for everything. It *sounds* like you have an unofficial Ubuntu build that does something unusual and therefore is *not* governed by the same rules of Ubuntu 22.04. Where did you get the Ubuntu 22.04 installer/ISO?
Richard C avatar
sl flag
I had the same issue and I downloaded the latest ISO from the ubuntu website. This is definitely an issue with the combination of ubuntu / VirtualBox and only seems to happen with the unattended installation option
cn flag
This may be a duplicate of https://askubuntu.com/questions/1440032/virtualbox-ubuntu-22-04-how-to-add-sudo-rights .
cn flag
related: [How can I make my own account a sudoers on VirtualBox?](https://superuser.com/questions/1623376/how-can-i-make-my-own-account-a-sudoers-on-virtualbox)
Score:1
lb flag

So, I found a colleague who suggested I try to login using "su root" and then enter the password for the first user created (which was NOT root). Sure enough, it worked!

This appears to be a bug? The default root user shouldn't have been created with a password, and the first user I created (which wasn't named "root") should have been given the option to be given admin access.

I'm not sure if this is an Ubuntu install issue, or a VirtualBox 7 issue.

Pilot6 avatar
cn flag
It looks like you install some unofficial Ubuntu build.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.