ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
6

Installing ROS on Ubuntu Bash in Windows 10

asked 2016-07-02 14:39:50 -0600

Mahmoud Abdul Galil gravatar image

updated 2016-07-02 19:55:11 -0600

Hello, everyone.

This is rather a documentation of what I came across while messing around. Windows 10 in the latest release in April features an internal Ubuntu OS in the build, This holds the possibility for installing ROS on Ubuntu directly.

In order to install it, I followed the instructions on building ROS from source on the wiki : ROS Indigo Source Installation

The version of Ubuntu in Windows 10 is 14.04, so Indigo and earlier versions will work, most likely.

Try it out, and if you face problems, please document them here. Thanks

edit retag flag offensive close merge delete

4 Answers

Sort by » oldest newest most voted
18

answered 2016-07-03 00:53:23 -0600

gvdhoorn gravatar image

updated 2017-10-28 05:31:02 -0600

Update (2017-10-28): @k-okada

I have successfully running ros, rviz + stage or rviz + gazebo (though the gazebo screen is black), on Windows Fall Creators Updates

roslaunch navigation_stage move_base_amcl_2.5cm.launch roslaunch nextage_gazebo nextage_world.launch


Update (2017-05-09):

There is now a PR against ros_comm (ros/ros_comm#1050) which appears to address one of the main remaining issues with ROS on WSL.

A regular ROS install with ros_comm (really only roscpp) with the patch built from sources in an overlay workspace now results in an (almost) working ROS install running on WSL on build 16188.


Update (2017-04-05) by @RodBelaFarin:

Status quo in build 15063: roscore, turtlesim, rviz, rqt_graph starting up, rostopic list works, even rostopic echo works sometimes, but no communication between nodes. Using WSL 14.04 and Indigo binary install, just added localhost to .bashrc as ROS_MASTER_URI and ROS_HOSTNAME. Using Xming and DISPLAY=:0.


Update (2017-02-02): Build 15019 hasn't improved things significantly, but at least most of the tricks for getting networking to work (Teredo issue etc) have been addressed.

See Microsoft/BashOnWindows/#issues/1450 and Microsoft/BashOnWindows#1391 for issues tracking current state / progress.


Update (2016-11-11): the Anniversary Update didn't improve things, but as of Build 14965, the below mentioned getifaddrs preload library is no longer needed. Network interface enumeration now works correctly. If you are having problems (permission denied errors from Python netifaces.interfaces(), see this comment about the Teredo interface.

RQT runs (after export DISPLAY=:0 and installing an X server on Windows). RViz could work, if you have an X server supporting OpenGL.

One remaining issue is that there is still a problem with publishing and subscribing from WSL.

Note that new installations of WSL will install Ubuntu Xenial (16.04), requiring you to install ROS Kinetic. Just follow the Ubuntu ROS Kinetic installation documentation.


tl;dr: you can install ROS Indigo for amd64 from binaries on WSL, but the current state of the network stack is such that it makes any kind of serious use of ROSonWSL impossible (at least as of build 14376 14905).

edit: it could be that things will improve after the Anniversary Update (from Microsoft/BashOnWindows#567):

We are working to enhance the networking/socket level support post Anniversary update release. Stay tuned!


(note: the following text is left here for reference only. Most of the comments about the networking stack don't apply to recent builds any more)

It's perfectly possible to install ROS on WSL as you found out: just follow the Ubuntu Trusty installation tutorial. No need to build from source actually, WSL supports the amd64 architecture, which is well supported by the ROS buildfarm.

The problem is that for ROS to be really useful (other than just using it as a build infrastructure on a Windows10 machine) the networking support in WSL needs to be extended significantly ... (more)

edit flag offensive delete link more

Comments

edit: it could be that things will improve after the Anniversary Update (from Microsoft/BashOnWindows#567

I just installed the anniversary update. roscore still doesn't work.:

Jon Stephan gravatar imageJon Stephan ( 2016-09-24 17:33:05 -0600 )edit

Yes, I can confirm that. Haven't been keeping this post up-to-date. Latest builds (14926) don't change anything. But things are moving, as the status of the user voice topic about netlink/raw socket support has been changed to working on it.

gvdhoorn gravatar imagegvdhoorn ( 2016-09-25 04:51:11 -0600 )edit
tjs000 gravatar imagetjs000 ( 2016-10-12 19:13:03 -0600 )edit

Yes, that is bad form. I've seen your post, but haven't had time to check what is going wrong.

If you've just installed that Win10 machine, it could be that it's now running a 16.04 root fs, which might have introduced changes to how getifaddrs(..) is supposed to work.

gvdhoorn gravatar imagegvdhoorn ( 2016-10-13 07:10:46 -0600 )edit

I'm sorry. I think that it probably is related to that. Thankyou for even reading the post. I will check back daily and if there's anything that you need from me i'll be happy to provide it, but obviously there is no pressure... :)

tjs000 gravatar imagetjs000 ( 2016-10-13 08:02:39 -0600 )edit

Don't worry about it. Could you perhaps report the issue to the issue tracker over at gavanderhoorn/getifaddrs_preload? Thanks.

gvdhoorn gravatar imagegvdhoorn ( 2016-10-13 08:31:26 -0600 )edit

I'd actually be interested how you got RViz to work on WSL. Which XServer did you install? Anything special on the WSL side? Last time I tried it always crashed.

gvdhoorn gravatar imagegvdhoorn ( 2016-10-13 08:32:49 -0600 )edit

I just put 'export DISPLAY=:0' in ~/.bashrc and used Xming in Windows. RViz starts then complains that roscore isn't running so that's as far as I can get now.

tjs000 gravatar imagetjs000 ( 2016-10-13 10:50:32 -0600 )edit
0

answered 2017-05-12 04:49:40 -0600

majid gravatar image

Is there any thing to do for fixing the problem? I am new with ROS. I install the ROS on bash, roscore, rosnode ping, rqt_graph and turtlesim also work. I just get the following error

I did your edit in transport_tcp.cpp file. (ros/ros_comm#1050) But I still have the problem. nodes do not communicate

edit flag offensive delete link more

Comments

1

This is not an answer, but a new question. Please post this as a new question.

gvdhoorn gravatar imagegvdhoorn ( 2017-05-12 06:02:00 -0600 )edit
0

answered 2016-10-11 17:54:17 -0600

tjs000 gravatar image

Evening, trying to install ROS on a second computer with WSL. Done all of the normal ROS installation steps, and as expected, roscore fails because it can't get the network interfaces.

I downloaded and did 'make' on the custom _getifaddrs function as I have done previously to get this to work. This compilation warns of an implicit declaration of the 'inet_aton' function, but appears to complete correctly and produces the .so file.

When I try to run roscore with the LD_PRELOAD....... line, it appears to start as normal, then when it get's to 'NODES', crashes with the error:

* stack smashing detected *: /usr/bin/python terminated Aborted (core dumped)

I gather from some quick googling that this is related to a buffer overflow, but looking at the source, I fail to see where this can have occurred.

I know that this has worked previously in the same environment because i've had rviz working and that requires roscore to be running to start correctly.

I've tried reinstalling ubuntu in WSL with no luck, if anyone has any ideas i'd welcome them!! Thanks

edit flag offensive delete link more
0

answered 2016-07-02 14:51:42 -0600

Mahmoud Abdul Galil gravatar image

updated 2016-07-02 19:51:58 -0600

Well, seems it doesn't work. I get this error when I finished installation and tried running roscore

Traceback (most recent call last):
File "/home/mahmoud/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages/roslaunch/__init__.py", line 307 , in main
p.start()
File "/home/mahmoud/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages/roslaunch/parent.py", line 279, in start
self.runner.launch()
File "/home/mahmoud/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages/roslaunch/launch.py", line 654, in launch
self._setup()
File "/home/mahmoud/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages/roslaunch/launch.py", line 630, in _setup
self._launch_master()
File "/home/mahmoud/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages/roslaunch/launch.py", line 394, in _launch_master
validate_master_launch(m, self.is_core, self.is_rostest)
File "/home/mahmoud/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages/roslaunch/launch.py", line 83, i n validate_master_launch
if not rosgraph.network.is_local_address(m.get_host()):
File "/home/mahmoud/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages/rosgraph/network.py", line 176, in is_local_address
local_addresses = ['localhost'] + get_local_addresses()
File "/home/mahmoud/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages/rosgraph/network.py", line 219, in get_local_addresses
for iface in netifaces.interfaces():
OSError: [Errno 22] Invalid argument


Edit

By tracing the errors above to the file "ros_catkin_ws/install_isolated/lib/python2.7/dist-packages/rosgraph/network.py", the error is in netifaces.interface() , so I tried using the module netifaces on its own for basic use in a python shell and I got the following error:

import netifaces

netifaces.interfaces()

Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: [Errno 22] Invalid argument

thus I searched for the source of the module and I had to download the source package from: netifaces - Python, and currently i'm checking possible causes of this error. If there is anyone interested in helping, that would be appreciated

edit flag offensive delete link more

Comments

already tried as well and failed, but I didn't put more efforts into it since you cant use any gui application.

m4k gravatar imagem4k ( 2016-07-02 16:36:00 -0600 )edit

that's just not true. You need an x server. Install XMing or XVServ. Gazebo for instance can be used on ubuntu for windows 10.

petermitrano gravatar imagepetermitrano ( 2016-07-02 17:20:14 -0600 )edit

Try settings ROS_IP and ROS_MASTER_URI manually. WSL doesn't get ifconfig/networking stuff correct and roscore likely uses that.

petermitrano gravatar imagepetermitrano ( 2016-07-02 17:21:03 -0600 )edit

I tried setting ROS_MASTER_URI, but it didn't work, i'm still getting the same error

Mahmoud Abdul Galil gravatar imageMahmoud Abdul Galil ( 2016-07-02 17:57:02 -0600 )edit

/Off topic, I knew of the XVServ solution. Is it a practical solution? If I understood the technique right, its running the gui "emulated/precalculated", not native. This is ok for a static gui with buttons etc, but gazebo/3D animation? I had performance concerns. Are you using it day-to-day?

m4k gravatar imagem4k ( 2016-07-02 17:57:13 -0600 )edit
1

nope, it's pretty awful performance. Frame rate is a bit lower than I'd like.

petermitrano gravatar imagepetermitrano ( 2016-07-03 13:16:53 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

5 followers

Stats

Asked: 2016-07-02 14:39:50 -0600

Seen: 9,004 times

Last updated: Oct 28