How to discover the hostname on which the VirtualBox GUI runs?
How to discover the hostname on which the VirtualBox GUI runs?
I run VirtualBox on multiple CentOS hosts, and on occasion, I have several VirtualBox GUIs open on my workstation.[1]
I didn't find a way to discover - from a VirtualBox GUI, which is the hostname the VirtualBox GUI is running on.
Do you know where I can find the host hostname on which the VirtualBox runs?
---
[1] I ssh to the target VirtualBox machine with ssh -Y, and then
when I issue the command virtualbox, the VirtualBox GUI shows on my workstation.
I didn't find a way to discover - from a VirtualBox GUI, which is the hostname the VirtualBox GUI is running on.
Do you know where I can find the host hostname on which the VirtualBox runs?
---
[1] I ssh to the target VirtualBox machine with ssh -Y, and then
when I issue the command virtualbox, the VirtualBox GUI shows on my workstation.
-
- Volunteer
- Posts: 5677
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: How to discover the hostname on which the VirtualBox GUI runs?
Some ideas where to place the hostname in the VirtualBox GUI app window:
- In the VirtualBox GUI app, you can see the names of the VMs, and their Description on the Details pane.
- Depending on your workstation's window manager, you can set your X11 window's title.
Re: How to discover the hostname on which the VirtualBox GUI runs?
I'm expecting that from somewhere in the VirtualBox GUI, the VirtualBox host's hostname would be available.
I just cannot determine where this place in the GUI is.-
- Volunteer
- Posts: 5677
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: How to discover the hostname on which the VirtualBox GUI runs?
I'm not sure if I understand you correctly, so let me explain:rbarak wrote:I'm expecting that from somewhere in the VirtualBox GUI, the VirtualBox host's hostname would be available.
I just cannot determine where this place in the GUI is.
- Like any program, the VirtualBox GUI app knows the hostname of the host it is running on (inherited from the shell environment), and like most programs, it does not display it anywhere in it's GUI (as far as I know).
- If you use any kind of remote management system (you mentioned SSH with X11 forwarding), it would be the task of the remote management system to display the hostnames corresponding to the remote management windows displayed.
- Since the hostname currently is not displayed, I made three suggestions (not ready made solutions) where you can get it displayed.
-
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: How to discover the hostname on which the VirtualBox GUI runs?
Why would you expect that? Can you name a couple of apps that include the hostname in the title? Like Firefox, Chrome, Notepad++, gedit or Calculator?rbarak wrote:I'm expecting that from somewhere in the VirtualBox GUI, the VirtualBox host's hostname would be available
Then you already know where you are! Just look at the last command issued in your host's Terminal, that should tell you where you are connected to.rbarak wrote:I ssh to the target VirtualBox machine
That's a great idea that could get you easily out of the "trouble", add as your first line in the Description of the VMs the hostname.fth0 wrote:In the VirtualBox GUI app, you can see the names of the VMs, and their Description on the Details pane.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
-
- 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 discover the hostname on which the VirtualBox GUI runs?
@rbarak: I'm also not sure I understand what you're trying to do. First we need to clarify terminology as it is generally used on this forum:
The physical PC that is running Virtualbox and has all the virtual machines running on it is called the "host".
The virtual machines are called the "guests".
The "Virtualbox GUI" is often thought of by me as the main Virtualbox window, the screenshot you posted in your second post.
The windows that show the guest operating systems are the "guest windows".
In normal parlance the "hostname" is the network name of the PC, either physical or virtual. For example, my house server is called "snchomeserver" and when I want to get to that computer on my network from my other PCs, I enter \\snchomeserver as the root path name. When I open a command prompt on that PC and enter the command 'hostname' it returns "snchomeserver".
For example, this:
Please clarify if you are ssh remoting into the CentOS host physical PCs, or are you ssh remoting into Virtualbox guests?
What exactly is the "hostname" you want to see?
The physical PC that is running Virtualbox and has all the virtual machines running on it is called the "host".
The virtual machines are called the "guests".
The "Virtualbox GUI" is often thought of by me as the main Virtualbox window, the screenshot you posted in your second post.
The windows that show the guest operating systems are the "guest windows".
In normal parlance the "hostname" is the network name of the PC, either physical or virtual. For example, my house server is called "snchomeserver" and when I want to get to that computer on my network from my other PCs, I enter \\snchomeserver as the root path name. When I open a command prompt on that PC and enter the command 'hostname' it returns "snchomeserver".
For example, this:
means you have lots of physical PCs with CentOS as the operating system installed on the PCs, and these PCs are running Virtualbox.rbarak wrote:I run VirtualBox on multiple CentOS hosts
Sounds like this 'virtualbox' command is going to the host PC. I enter 'virtualbox' at a command prompt and I get the main Virtualbox window popping open on my host desktop too. Entering the command again makes another main Virtualbox window, etc. Are you trying to get the 'virtualbox' command to go to your guest through ssh? It sounds like it isn't getting there.rbarak wrote:I have several VirtualBox GUIs open on my workstation....
I ssh to the target VirtualBox machine with ssh -Y, and then when I issue the command virtualbox, the VirtualBox GUI shows on my workstation.
Please clarify if you are ssh remoting into the CentOS host physical PCs, or are you ssh remoting into Virtualbox guests?
What exactly is the "hostname" you want to see?
How to make X11 display the VirtualBox hostname in the Window's title?
When I open VirtualBox GUIs from remote machines on my workstation,[1] the GUI title does not show the hostname on which the VirtualBox GUI runs.
Is there a way to make X11 display that hostname in the Window's title (e.g., to get a title like the below, with the (on <hostname>))?
---
[1] I connect to the remote machine with
Is there a way to make X11 display that hostname in the Window's title (e.g., to get a title like the below, with the (on <hostname>))?
---
[1] I connect to the remote machine with
ssh -Y <hostname>
Re: How to make X11 display the VirtualBox hostname in the Window's title?
You've already asked a very similar question here: viewtopic.php?f=1&t=94122
I doubt that asking almost the same thing in another way in another forum is going to gain any different responses; and the duplication will not go down well with the Forum Admins.
I doubt that asking almost the same thing in another way in another forum is going to gain any different responses; and the duplication will not go down well with the Forum Admins.
Re: How to make X11 display the VirtualBox hostname in the Window's title?
Thanks for your concern, @erdeslawe.
The previous question you mentioned - was rather general.
Based on the replies I received to it (and elsewhere) I created this new question,
which is focused on the probable solution domain, and was asked of the Linux sub-group - which is probably where the specific solution knowledge lies.
The previous question you mentioned - was rather general.
Based on the replies I received to it (and elsewhere) I created this new question,
which is focused on the probable solution domain, and was asked of the Linux sub-group - which is probably where the specific solution knowledge lies.
Re: How to discover the hostname on which the VirtualBox GUI runs?
From <my workstation> I do
If I have several of these VirtualBox GUIs displayed on <my workstation>, then it's difficult to know who's whom, without being able to see, or enquire of, the <remote hostname> somewhere on the VirtualBox GUI.
ssh -Y <remote hostname>and then on <remote hostname> I do
virtualboxwhich causes the VirtualBox GUI to be displayed by X11 on <my workstation>.
If I have several of these VirtualBox GUIs displayed on <my workstation>, then it's difficult to know who's whom, without being able to see, or enquire of, the <remote hostname> somewhere on the VirtualBox GUI.
-
- 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 discover the hostname on which the VirtualBox GUI runs?
Ok, so I'm a Windows guy, so let me understand: You ssh into another PC and if the command you run on the remote PC opens a window, it opens on your local PC? Interesting.
If I've understood right, then I can see how you'd have a group of main Virtualbox windows, one for each remote Virtualbox host you've ssh'ed into and run the 'virtualbox' command on. These windows are connected to the remote hosts. However, which window is connected to which host is not shown. Yep, that would be hard to handle.
Second However: Virtualbox does not have any programmed capability to display the name of the host PC it's running on in the main Virtualbox window. As Socratis and fth0 mention, displaying the hostname of the PC an application is running on within the application is possible. (In fact I have a vbscript I use on my home & backup servers that gets the server's hostname for the script's output, so it is possible.) But Virtualbox is not programmed to show the hostname at this time.
You will need to use a different remote software to show the hostname along with the window from the remote PC. Meanwhile you can suggest this hostname display idea in the Bugtracker as an enhancement (don't hold your breath waiting for the idea to be included though. You can also get the source-code and insert the code for your own hosts. Finally, you could as fth0 indicated, use the Description tab of the guests as a place to put info, such as put the hostname in the Description of each PC's first guest.
If I've understood right, then I can see how you'd have a group of main Virtualbox windows, one for each remote Virtualbox host you've ssh'ed into and run the 'virtualbox' command on. These windows are connected to the remote hosts. However, which window is connected to which host is not shown. Yep, that would be hard to handle.
Second However: Virtualbox does not have any programmed capability to display the name of the host PC it's running on in the main Virtualbox window. As Socratis and fth0 mention, displaying the hostname of the PC an application is running on within the application is possible. (In fact I have a vbscript I use on my home & backup servers that gets the server's hostname for the script's output, so it is possible.) But Virtualbox is not programmed to show the hostname at this time.
You will need to use a different remote software to show the hostname along with the window from the remote PC. Meanwhile you can suggest this hostname display idea in the Bugtracker as an enhancement (don't hold your breath waiting for the idea to be included though. You can also get the source-code and insert the code for your own hosts. Finally, you could as fth0 indicated, use the Description tab of the guests as a place to put info, such as put the hostname in the Description of each PC's first guest.
-
- Volunteer
- Posts: 5677
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: How to make X11 display the VirtualBox hostname in the Window's title?
Use xdotool on your workstation, e.g.:
Code: Select all
xdotool search --name "Oracle VM VirtualBox Manager" set_window --name "Oracle VM VirtualBox Manager (on ember)"
Re: How to discover the hostname on which the VirtualBox GUI runs?
(The magic of X11)scottgus1 wrote:Ok, so I'm a Windows guy, so let me understand: You ssh into another PC and if the command you run on the remote PC opens a window, it opens on your local PC? Interesting.
Yes, I figured that I need to diagnose why X11 does not display the hostname on the Window title, e.g. - as you can see at the bottom window in the screenshot: Thus, I created a more focused question here.scottgus1 wrote:If I've understood right, then I can see how you'd have a group of main Virtualbox windows, one for each remote Virtualbox host you've ssh'ed into and run the 'virtualbox' command on. These windows are connected to the remote hosts. However, which window is connected to which host is not shown. Yep, that would be hard to handle.
Second However: Virtualbox does not have any programmed capability to display the name of the host PC it's running on in the main Virtualbox window. As Socratis and fth0 mention, displaying the hostname of the PC an application is running on within the application is possible. (In fact I have a vbscript I use on my home & backup servers that gets the server's hostname for the script's output, so it is possible.) But Virtualbox is not programmed to show the hostname at this time.
You will need to use a different remote software to show the hostname along with the window from the remote PC. Meanwhile you can suggest this hostname display idea in the Bugtracker as an enhancement (don't hold your breath waiting for the idea to be included though. You can also get the source-code and insert the code for your own hosts. Finally, you could as fth0 indicated, use the Description tab of the guests as a place to put info, such as put the hostname in the Description of each PC's first guest.
Re: How to make X11 display the VirtualBox hostname in the Window's title?
You're suggesting a sort of Catch 22 solution.fth0 wrote:Use xdotool on your workstation, e.g.:Code: Select all
xdotool search --name "Oracle VM VirtualBox Manager" set_window --name "Oracle VM VirtualBox Manager (on ember)"
My problem is that I have a group of Windows, all of them named "Oracle VM VirtualBox Manager", which I don't know on which hostname each of them runs.
Thus, I cannot really use your xdtool suggestion, as I don't know what to give as the --name argument.
-
- Volunteer
- Posts: 5677
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: How to make X11 display the VirtualBox hostname in the Window's title?
It depends on your (automated?) workflow that creates the Windows:
I could imagine a shell script that opens an SSH session to a host, starts the VirtualBox GUI, and calls xdotool in one go. Using this shell script for each host in turn ...
I could imagine a shell script that opens an SSH session to a host, starts the VirtualBox GUI, and calls xdotool in one go. Using this shell script for each host in turn ...