How to report the guest status using correct (local) timezone ?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
bluegroper
Posts: 50
Joined: 22. Dec 2008, 08:14
Primary OS: FreeBSD
VBox Version: OSE other
Guest OSses: Windozes, Linuxes, BSD's
Location: Would rather be swimming.

How to report the guest status using correct (local) timezone ?

Post by bluegroper »

Hi forum
I have various guest VM's running on CentOS 7 host.
The host tz is set to local time. Clocks are correctly synced using ntp servers as usual.

I like to check the status of guest VM's using :

Code: Select all

VBoxManage list vms -l | grep -e ^Name: -e ^State | sed s/\ \ //g | cut -d: -f2-
But this reports the status of each guest VM since datetime in UTC.
How to report the guest status using correct (local) timezone ?
How to change the time-zone setting of existing guest VM's ?
I can see VBoxManage has an option to set the guest time-zone, BUT this only applies when doing an install.
TIA's for any tips or clues.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: How to report the guest status using correct (local) timezone ?

Post by scottgus1 »

Virtualbox does not appear to have any setting to control how the time is reported, unless there is a switch buried in the source code. (Scan the PDF of the manual for 'UTC'.)

I have done some scripting in the past related to time, and it is common for computers to report time in UTC, regardless of the source program. Web-search how to convert UTC to local time for a scripting language compatible with your host OS and how to determine your computer's time zone and daylight-savings status. Then convert Virtualbox's output through the conversion script.
Post Reply