Can't find any vm logs

Paul Smith

Cadet
Joined
Mar 9, 2022
Messages
4
Hi all,
first posting but I have been using FreeNas/TrueNAS for a number of years so Im not a total newbie.

I have a missing /var/log/vm directory on a new machine I'm setting up. The VM's are running fine, but not creating any log files. (TrueNAS 12.0-U8)

I'm trying to replicate an old machine that we have running FreeNAS-11.3-U5, so I can copmletely overhaul the hardware. This old machine *does* have a /var/log/vm directory and it does contain log files.

Am I missing a checkbox somewhere? I did try creating the /var/log/vm directory but it remained empty.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
You might find that the logging changed between versions (I note the logs of my VMs haven't updated since June 2020, so I suppose coincides with some update along the way), but also that you're playing in a path that is contained in the system dataset(s) so there are strange things going on in the background which may be showing you things that aren't as they seem. (like the actual path of that log file being /var/db/system/syslog-eff1308c28ee49df8340e80e9a4cfba9/log/vm)

How are you checking that?
 

Paul Smith

Cadet
Joined
Mar 9, 2022
Messages
4
You might find that the logging changed between versions (I note the logs of my VMs haven't updated since June 2020, so I suppose coincides with some update along the way), but also that you're playing in a path that is contained in the system dataset(s) so there are strange things going on in the background which may be showing you things that aren't as they seem. (like the actual path of that log file being /var/db/system/syslog-eff1308c28ee49df8340e80e9a4cfba9/log/vm)

How are you checking that?
According to the documentation I'm reading ( https://cdn-www.ixsystems.com/documentation/truenas/11.3-U5/virtualmachines.html ) , it still reports that a log file should exist in /var/log/vm, so perhaps if you are right the documentation just needs updating.

I will have scout around the filesystem to see if I can find the log elsewhere and report back....Sod's law though - I've just turned it off to relocate the hardware and I won't be in a positioni to be able to check that until possibly tomorrow.
 

Paul Smith

Cadet
Joined
Mar 9, 2022
Messages
4
Ooh....
so if I cd /var/log on the TrueNAS box, then cd .. I end up in /var/db/system/syslog-a62da1........ !

That directory contains a subdirecoty of log, but there's still no vm subdirectory in there either.

RESOLUTION (ish)
So, it looks like the TrueNAS documentation isn't quite right and needs updating, although I'm obviously not sure at which point it changed.

Firstly, I did;
ps -x | grep bhyve
which told me the VM's that were running and in my case was 2_Gitlab
find / -name '*2_Gitlab*'
revealed that the logs were 'hidden' in log/libvirt underneath that syslog-a62da1..... directory.

So to get to the log I have to do
cd /var/log
cd ..
(or cd /var/db/system/syslog-xxxxxxxxx)
cd log/libvirt/bhyve


and there are my VM logs.


So that just raises some further questions:
  • What the heck is the directory syslog-a62da1995........
  • Is it's name likely to change ?
  • Can I create an alias for it that will stick, or is there an easier way to get to that directory?
  • Is this a FreeBSD thing, or is it a TrueNAS thing?


Thanks for your help sretalla
 

Paul Smith

Cadet
Joined
Mar 9, 2022
Messages
4
Ooh....
so if I cd /var/log on the TrueNAS box, then cd .. I end up in /var/db/system/syslog-a62da1........ !

That directory contains a subdirecoty of log, but there's still no vm subdirectory in there either.

RESOLUTION (ish)
So, it looks like the TrueNAS documentation isn't quite right and needs updating, although I'm obviously not sure at which point it changed.

Firstly, I did;
ps -x | grep bhyve
which told me the VM's that were running and in my case was 2_Gitlab
find / -name '*2_Gitlab*'
revealed that the logs were 'hidden' in log/libvirt underneath that syslog-a62da1..... directory.

So to get to the log I have to do
cd /var/log
cd ..
(or cd /var/db/system/syslog-xxxxxxxxx)
cd log/libvirt/bhyve


and there are my VM logs.


So that just raises some further questions:
  • What the heck is the directory syslog-a62da1995........
  • Is it's name likely to change ?
  • Can I create an alias for it that will stick, or is there an easier way to get to that directory?
  • Is this a FreeBSD thing, or is it a TrueNAS thing?


Thanks for your help sretalla
TLDR; Logs are now located in /var/log/libvirt/bhyve
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
What the heck is the directory syslog-a62da1995........
That's where the system dataset is mounted.

Is it's name likely to change ?
I don't think so. (but the hardlink is there anyway).

Can I create an alias for it that will stick, or is there an easier way to get to that directory?
There's already one... not sure if you or something else messed with it by creating a directory in that location as part of troubleshooting.

I guess you can make another one with ln

Is this a FreeBSD thing, or is it a TrueNAS thing?
It's a peculiarity to TrueNAS. FreeBSD just puts things directly in /var/log (unless you arrange it otherwise).
 
Top