3

I am attempting to install OpenTreeMap in a Ubuntu environment. Hosted at DigitalOcean, one of their "Droplets". As part of the install process I have installed and configured Virtual Box and Vagrant to virtualize the environment. I have made it part-way through various apt-get install and each time, I am disconnected from the Virtual box.

[Unpacking libicu48 (from .../libicu48_4.8.1.1-3_i386.deb) ... [/*varies*/]
Connection to 127.0.0.1 closed by remote host.
Connection to 127.0.0.1 closed.

I execute using:

vagrant up
vagrant ssh

Once virtualized, the connection is closed when downloading/installing packages. Not always the same stop point, but it always forces a disconnect. I am still connected to my box via SSH, and when I run vagrant status I show the virtual box as "aborted":

Current VM states:

default                  aborted

The VM is in an aborted state. This means that it was abruptly
stopped without properly closing the session. Run `vagrant up`
to resume this virtual machine. If any problems persist, you may
have to destroy and restart the virtual machine.

UPDATE: Tried the recommendation in the comments, I got further through the process and closer, but it is still forcing a disconnect through normal use of vagrant. This time, at a pip install command.

Any clue as to why this might be occurring?

Patrick Moore
  • 141
  • 1
  • 9

3 Answers3

1

I encountered the same issue, and it was the RAM, was filled by a huge rsync command. Same applys for cp or mv from within a VM. I imagine that it will be the same with a big apt install ... on pip install .... You need more RAM or find workarounds.

You can try to figure it out too by running your script/provision and in another tab, htop from the host. For me, the RAM get filled more and more each seconds until the crash when Out Of Memory (OOM killer) occurs. The ssh error is just a consequence, not the root cause.

A posssible workaround is:

mount --bind host-shared-dir mountpoint

Note

If someone knows why cp/mv/rsync takes so much RAM from host when you rsync from within a VM, please explain ;)

Gilles Quénot
  • 1,313
  • 10
  • 17
1

Referring to the other answers here: Yes, it seems to be the RAM.

I've just had a similar issue with a freshly created Fedora vagrant environment on VirtualBox. When trying to do something like "dnf check-update", I got disconnected from the ssh session in the same way as the poster.

The RAM was set to only 512 MB in the VirtualBox settings. So I just increased it to 1024 MB. Looks like that has solved it.

... though it could be also that a reboot of my computer had a positive effect or even was the solution. Because sometimes I get messages from my OS that I'm short of RAM (I have some hard drive issues atm, though they are not too bad, so enough hd space for RAM swap space is sometimes not available), a reboot usually helps. I did a reboot shortly before I was changing the RAM amount within VirtualBox, so not sure now which of the two has solved the issue.

isenhaard
  • 11
  • 2
  • 1
    I would suggest you do a MEMTEST on your RAM. With a tool such as MemTest86 or similar. – yield Jul 26 '22 at 17:39
  • @yield Thanks for the suggestion, but actually I think the reason is that my hard drive is always at low space atm (plus some further hard drive related complications). So most probably there's no space for swap space (I'm on macOS btw.). Sorry for being not exact in my upper answer on this, cause I've kind of written I don't know why these massages are popping up, actually I know why. Will edit my answer now. – isenhaard Aug 03 '22 at 01:05
1

This sounds like 1 of 2 things:

  1. This part of your post: " I show the virtual box as "aborted":" makes it sound like the VM is kernel panicking and shutting down. If this is the case the VM image could be bad, or incompatible with Virtual box. You may try installing the Virtual box tools before you run updates. (https://forums.virtualbox.org/viewtopic.php?f=24&t=36752)

  2. SSH is timing out...: You could also edit your ssh config (~/.ssh/config on mac/linux) and add the text below. This will try and keep your ssh connection open longer. Your mileage will vary on this depending on your sshd config on the box you're connecting to.

    Host *
    ServerAliveInterval 25
    ServerAliveCountMax 20
    

You could also launch something like screen or tmux that would keep your session running. This would rule out SSH timeouts. This may be a bad idea if your updates require you to type Y/N at certain prompts etc...

Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47