Creating and connecting to Ubuntu server VM

Trying for the first time to do a VM on TrueNAS SCALE community edition (currently running 25.10.3.1 - Goldeye). (I used jails some in CORE, was hoping to bring some things I did that way back to life.)

The only way I can find to do anything is to connect via VNC. Doing that, I can interact with the install disk and watch much of the install go through – but at the end of that, it leaves me with a nearly-blank screen (still viewed via VNC) that says Ubuntu 24.04.4 LTS ubuntu-server tty1at the top. (Nothing I type in through VNC echos or causes any action; disconnecting VNC and reconnecting does show the same screen again, though.)

Note that this is an Ubuntu server install – no desktop.

Then I thought about a serial terminal connect, and noted the “serial shell” option in the VM. If I click that, what I get is

WARNING: Your user does not have sudo privileges so /usr/bin/virsh command will run
on your behalf. This might cause permission issues.

error: failed to connect to the hypervisor
error: authentication unavailable: no polkit agent available to authenticate action 'org.libvirt.unix.manage'

Repeating over and over again with a pause. (Not scrolling down the screen, blanking and starting at the top again.)

So,…what’s the deal? Seems like the VNC thing should be getting me in touch with the console on the VM, and it is for a while, I can see the install steps flowing by, but then it freezes up. And “serial shell” really sounds like it should get my a tty connection to the VM, but it fails with errors I don’t understand. I don’t think I did anything unusual – but who knows, this whole VM procedure in the TrueNAS GUI is new to me. Help?

The sudo issue is easily rectified. Just add sudo privileges to the user you use to login to the UI.

Well, it changes things. Does it need to be all command, passwordless? Or just anything at all?

I added sudo, all commands, and now the serial shell connection gives me:

Connected to domain '13_fsfsdev3'
Escape character is ^]

but nothing I type echoes, and if I do type the escape character, it just clears the screen and re-types the same message.

Still, it changed behavior, so your sudo change is clearly somewhat relevant.

Try restarting the Ubuntu VM, and then launching the Serial Shell immediately afterwards. When you get to grub, edit the kernel line for Ubuntu server to include a nomodeset option before –.

I do get to grub. Looks like the install never completed. So messing around with that, and will try your nomodeset option suggestion. Probably after dinner.

1 Like

In addition to nomodeset, try adding console=ttyS0 to the grub linux line to get output in the Serial Shell.

nomodeset plus console=ttyS0 got me the install running via the serial shell connection.

But only for a while; got this far and just stopped.

[  OK  ] Started cron.service - Regular background program processing daemon.
Starting dbus.service - D-Bus System Message Bus…
[  OK  ] Started dmesg.service - Save initial kernel messages after boot.
Starting e2scrub_reap.service - Re…ne ext4 Metadata Check Snapshots…
Starting polkit.service - Authorization Manager…
Starting pollinate.service - Pollie pseudo random number generator…
Starting rsyslog.service - System Logging Service…
[  OK  ] Reached target getty-pre.target - Preparation for Logins.
Starting snapd.seeded.service - Wait until snapd is fully seeded…
Starting snapd.service - Snap Daemon…
Starting sysstat.service - Resets System Activity Logs…
Starting systemd-logind.service - User Login Management…
Starting systemd-user-sessions.service - Permit User Sessions…
Starting udisks2.service - Disk Manager…
[  OK  ] Finished systemd-user-sessions.service - Permit User Sessions.
Starting plymouth-quit-wait.servicd until boot process finishes up…
Starting plymouth-quit.service - Terminate Plymouth Boot Screen…
[  OK  ] Started dbus.service - D-Bus System Message Bus.
[  OK  ] Finished sysstat.service - Resets System Activity Logs.
Starting systemd-hostnamed.service - Hostname Service…
[  OK  ] Finished plymouth-quit.service - Terminate Plymouth Boot Screen.
[  OK  ] Finished plymouth-quit-wait.servicold until boot process finishes up.
[  OK  ] Started serial-getty@ttyS0.service installer for Ubuntu Server ttyS0.
[  OK  ] Reached target getty.target - Login Prompts.
Starting setvtrgb.service - Set console scheme…
[  OK  ] Started systemd-hostnamed.service - Hostname Service.
[  OK  ] Started systemd-logind.service - User Login Management.
[  OK  ] Started unattended-upgrades.service - Unattended Upgrades Shutdown.
[  OK  ] Finished e2scrub_reap.service - Re…line ext4 Metadata Check Snapshots.
[  OK  ] Finished setvtrgb.service - Set console scheme.
[  OK  ] Started polkit.service - Authorization Manager.
Starting ModemManager.service - Modem Manager…
[  OK  ] Started rsyslog.service - System Logging Service.

Ubuntu 24.04.4 LTS ubuntu-server ttyS0

It echos characters I type, but does not in any other way respond to them. Stayed there for many minutes. Then seemed to lose the connection.

It might be changing the serial speed. Try console=tty0 console=ttyS0,115200. This should give you console on both the VNC window and the Serial Shell.

You may also need to check the “Ensure Display Device” box under the VM’s GPU settings.

Doesn’t seem to make any difference.

Essentially everything works for a while, starts the install, does screens and screens of logging. Then it hangs.

Has anybody actually gotten an Ubuntu server VM working in TrueNAS SCALE?

Sure, for several years and currently running Ubuntu server 24.04 with several apps on Truenas CE 25.10.3 but work from the VM’s CLI after logging in through SSH.

Maybe the hang is caused by something entered in the VM’s setup screens.

I have one running too.

  • UEFI
  • TPM enabled (switches machine type to Q35)
  • CPU = host passthrough
  • ensure display device

Well, that’s hopeful, anyway. Didn’t seem likely the whole VM scheme didn’t work, but having multiple people actually confirm they’ve got it working is encouraging.

There are enough selections in VM creation that I don’t fully understand that it’s completely possible I’ve got something wrong. (I’ve run vmware and virtualbox VMs quite a lot in various contexts, and even when it was completely new to me I’ve never had anything like this amount of trouble getting one set up.)

Do people run the install through the serial shell, or through VNC mostly?

Let’s see. My config params are:

Boot method: UEFI

Hyper-V: off (that’s for windows, according to the docs)

TPM: off (needed for windows, but this is for an Ubuntu guest)

1 cpu, 2 cores, 1 thread

CPU mode: host model (also tried passthrough for some).

No CPU set, no pin CPUs

Memory size 4GB, minimum memory 512MB (tried various)

NUMA nodeset: blank

Ensure dislplay device: tried both on and off

I use (Tiger) VNC.

Suggest you try installing with 2 threads in a custom CPU mode with display device enabled.

Also don’t set Ubuntu to be updated on install. Do that later.

Custom CPU mode I was avoiding since it seems to ask for something much harder than presenting the actual host CPU. And also because I tried to use it once and discovered that the first 3 CPU models I tried from the list couldn’t be supported on my actual CPU (which also confirmed my feeling that it was a complication).

Not clear on “Host MOdel” vs. “Host passthrough”, either. The docs read to me like “host model” is the simplest case, though?

Not clear from the docs what “display device” even is; but since what I’m looking for is a headless server install, basically?

Okay, I’ll try a few more different things, see if they go anywhere.

Hey, something here has caused a breakthrough – the installer actually asked me what language and keyboard I’m using! Never got that before.

Will take a while to run this through, and maybe I’ll be able to figure out exactly what’s different that matters.

(This run is host passthrough, 2 threads per CPU. Oh, and I removed the minimum memory setting. The threads may be the only thing I never tried before, but the combination isn’t one I’ve used I don’t think.)

Anyway, breakthrough; dunno if this will lead directly to a win yet, but further along than ever before. Thank you for that!

1 Like

Got a complete install, can ssh to the virtual.

After confirming it can restart successfully, I changed cpu mode from host passthrough to host model. That still boots. (Of course, the install might possibly not work in a configuration that will, after installation, boot?)

I’ll probably poke at other things, see what will and won’t run.

One immediate question though; where is the disk storage for this virtual? I picked a pool, I remember, but nothing has appeared any of the places I think of.

If you didn’t manually provision a zvol ahead of time, look in the VM disk device for the path to the zvol for the disk image.

Yeah, that’s where I looked first.

Huh; never saw /dev/zvol before, but it exists. So the path given there exists. It traces back through symlinks to a block special device /dev/zd0. So there isn’t a filesystem containing that data accessible from the host? (Used jails for years, got kind of used to the way things worked there.) Can I get it to do something else?