Extreme newbie: demo in virtualbox VM

tl;dr: How do I choose the ip and port to expose for the “demo” command?

Hi all, first post here. I’m currently researching options for a very large project, and somehow stumbled upon cockroachdb, which looks very interesting!

In order to try to test it out, I installed 19.2.6 in an Ubuntu 64bit virtualbox VM, inside a linux host machine. I can ssh into the VM no problem, and can run the cockroach demo, and check the web UI on a browser from within the VM. However the demo chooses some strange options, like to expose the ports on an ip in 127.x.x.x where none of those x’s are 0 or 1. (ie, it’s not, nor the VM’s assigned ip on 192.168.x.x – the one I use to ssh into it – nor the ip reported by ifconfig) I find myself unable to therefore connect to either the db or the ui from outside the VM. I have not made it to the point where I run my own “start” command in cockroachdb, as I am still trying to learn all the different things. I did try specifying --listen-addr and --http-addr, but that does not seem to be implemented for demo, so I’m stuck.

I basically just want to run:

cockroachdb demo

in the VM and be able to connect to it from outside the VM, both to the db and the web ui. Is this possible? If not, is it too big a request to ask that it be implemented for 19.2.7?

I realize I could probably start straight away with creating my own database and populating it, but my team will have some much less technical people also playing around with things, and it will be best for them (and others) if demo could work in a VM straight out of the box (with its preloaded volatile data), so they don’t worry about screwing things up or having all the extra effort of having to clean up a database or VM if they do. I would also rather not have to do iptables acrobatics or loadbalancer setup just to get this first part to work (again, especially considering the less technical people on our team).

Thanks in advance, and I look forward to seeing what cockroachdb can do.

While I have your attention, the documentation can be a little cryptic and hard to sort out. Especially for someone used to the likes of the MySQL or Perl docs. They also don’t work too well on narrow windows (like on a smartphone, or a browser window that isn’t maximized) text in the main body gets cut off and so on.


Hi there, cockroach demo isn’t meant for something like this. I would recommend using cockroach start-single-node, which lets you configure the port and listening host. Use --help to get more details on these options.

Thanks for the feedback on the docs. I’ve forwarded it to our documentation team.


Hi Jordan, thank you for your reply! I went with:

cockroach start-single-node --insecure --store=type=mem,size=.5 --logtostderr=ERROR

Thanks for the tip!