$ docker version
Client:
Version: 1.9.1
API version: 1.21
Go version: go1.4.3
Git commit: a34a1d5
Built: Fri Nov 20 17:56:04 UTC 2015
OS/Arch: windows/amd64
Server:
Version: 1.9.1
API version: 1.21
Go version: go1.4.3
Git commit: a34a1d5
Built: Fri Nov 20 17:56:04 UTC 2015
OS/Arch: linux/amd64
Shutdown Linux VM on closing KitematicGo Back on the topdocker-machine lsdefault machine is still running.@davidshen84 The VM shutdown can take a few mins to execute. It's possible that you're checking as it's shutting down?
No, I just tried. I also checked the machine status from the virtual box
manager. Nothing happens after I close the Kitematic window.
On Sat, Jan 16, 2016 at 9:18 AM French Ben [email protected] wrote:
@davidshen84 https://github.com/davidshen84 The VM shutdown can take a
few mins to execute. It's possible that you're checking as it's shutting
down?—
Reply to this email directly or view it on GitHub
https://github.com/docker/kitematic/issues/1369#issuecomment-172142257.
Regards,
David
Somehow I missed the windows part - I was able to re-create this issue. Should be a simple fix on the shutdown hook.
I never tried that option, but I'll try and if I could reproduce it I'll work on a PR :)
thanks @alexandrev Should be a simple check on the close to see if it's a windows machine.
Right now the app only monitors quitting which I don't think is triggered on Windows.
Maybe it is not that easy, I think the problem is that the event (sent using atom/electron) is not received by the method in the app.js.
So, to make it clear:
if (os.platform() === 'win32') {
mainWindow.on('close', function () {
mainWindow.webContents.send('application:quitting');
console.log("event sent! ")
return true;
});
app.on('window-all-closed', function () {
app.quit();
});
I've added a console log to check the behavior, so here when I close the Kitematic the "event sent!" prints on the console.
But at the app.js
ipcRenderer.on('application:quitting', () => {
console.log("event received! ")
if (localStorage.getItem('settings.closeVMOnQuit') === 'true') {
machine.stop();
}
});
The "event received!" log never shows!
So, I think it is maybe a problem with the electron package. But I'm not sure. I'm going to keep doing test and I'm going to post it here.
interesting - I'm not sure if you're familiar with it, but it may be easier/faster to do qa within the web console:
var electron = require('electron')
var mainWindow = electron.remote.BrowserWindow.getCurrentWindow()
mainWindow.webContents.send('application:quitting')
Even in Kitematic 0.9.5, I see in VirtualBox that the VM is properly shutdown when I execute the above.
Thank @FrenchBen I use a lot the Chrome DevTools but I didn't think on doing it on this case but as you said It's a lot of easier :).
I've already find the problem because the snippet you print it is not working on Windows, but I think I found one. So, I'll keep you posted with the updates.
Thx!
The problem is not the logic or the library. All of that are working fine. The problem is the event "close". On MacOS X the event application:quitting is sending on app --> before:quit but on Windows is sending on mainWindows --> close. So, it seems like at that moment the "component" to receive the event already have been close.
As a test, I change the event from close to minimize and when I minimize the window the VM shut down. So, we only have to find the right event :)
Mmmmm I don't find any event that suits for this situation :(. So, I'm going to go trying to find another approach...
I see what you mean - we would need something like before:close - Maybe open an issue in the electron repo and see what they have to say?
Yeah, that will be right, but we have the app:before-quit that should do
the trick as it does on MacOS X but for some reason don't work the same on
Windows (maybe it is because the specific case we have in Kitematic but I'm
not an expert of that topic)
I will open a issue on electron and refer this issue to see what they think
:)
On Thu, Jan 21, 2016 at 8:20 PM French Ben [email protected] wrote:
I see what you mean - we would need something like before:close - Maybe
open an issue in the electron repo and see what they have to say?—
Reply to this email directly or view it on GitHub
https://github.com/docker/kitematic/issues/1369#issuecomment-173680227.
Done!
:+1:
Any movement on this?
I think it is fixed. I were using the DockerToolbox-1.12.2 on Windows, and the VM instance stop when I close Kitematic.
I am on macOS latest, and using DockerToolbox latest, and I have found there are times when closing kitematic that the VM does not stop and remains open in the background. Only notice and the mac is running slow and can see it still running in the activity tracker. I dont have repeatable steps, and seems to be intermittent.
@davidshen84 I am definitely seeing vBox not shutting down the VM. default remains running...
Running latest toolbox.
I am running Vbox 5.1.6. Could be Vbox is too old?
Shutting down the vm does take a few seconds... Can you consistently reproduce this? Did you change any of the pref for VM shutdown?
I have waited several minutes and the vbox headless remains in the background, and if i leave it running in the background all day it will sometimes spike to 1gb+ memory usage for some unknown reason (when kitmatic is not running).
Can be consistently reproduced.
I am thinking of just clearing VBOX completely and reinstalling fresh....
Have not touched the VM prefs.
Ya stll not sure what is going on. Deleted the default VM, reinstalled toolbox and reinstall toolbox. Vboxheadless still wont shutdown automatically when quiting Kitematic.
VBoxSVC keeps running when I close Kitematic. It even keeps my windows from shutting down properly..