<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>12447</bug_id>
          
          <creation_ts>2017-12-22 02:14:41 +0000</creation_ts>
          <short_desc>Need TUN enabled in CROPS container to run QEMU</short_desc>
          <delta_ts>2017-12-22 17:07:05 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>CROPS</product>
          <component>crops-default</component>
          <version>2.5</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>10713</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chin Huat Ang">chin.huat.ang</reporter>
          <assigned_to name="Todor Minchev">todor.minchev</assigned_to>
          <cc>joshuagloe</cc>
          
          <qa_contact name="Toaster default assignee">toaster</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>78813</commentid>
    <comment_count>0</comment_count>
    <who name="Chin Huat Ang">chin.huat.ang</who>
    <bug_when>2017-12-22 02:14:41 +0000</bug_when>
    <thetext>Here&apos;s how I tried to execute runqemu using Brian&apos;s prototype toolchain container, however runqemu failed complaining TUN is not enabled: 

parallels@ubuntu:~/sdk$ docker run --rm -it -v $PWD:$PWD bavery/scott:cross --workdir=$PWD --cmd=&quot;runqemu qemux86 $PWD/bzImage-qemux86.bin $PWD/MY_QEMU_ROOTFS&quot;
sourcing /opt/poky/sdk/environment-setup-i586-poky-linux
runqemu - INFO - Can&apos;t find required *.qemuboot.conf in /home/parallels/sdk/MY_QEMU_ROOTFS
runqemu - INFO - Assuming /home/parallels/sdk/MY_QEMU_ROOTFS is an nfs rootfs
runqemu - INFO - Assuming MACHINE = qemux86
runqemu - INFO - Can&apos;t find qemuboot conf file, DEPLOY_DIR_IMAGE is NULL!
runqemu - INFO - Setting STAGING_DIR_NATIVE to OECORE_NATIVE_SYSROOT (/opt/poky/sdk/sysroots/x86_64-pokysdk-linux)
runqemu - INFO - Setting STAGING_BINDIR_NATIVE to /opt/poky/sdk/sysroots/x86_64-pokysdk-linux/usr/bin
Traceback (most recent call last):
    File &quot;/opt/poky/sdk/sysroots/x86_64-pokysdk-linux/usr/bin/runqemu&quot;, line 1199, in &lt;module&gt;
      ret = main()
    File &quot;/opt/poky/sdk/sysroots/x86_64-pokysdk-linux/usr/bin/runqemu&quot;, line 1186, in main
      config.check_and_set()
    File &quot;/opt/poky/sdk/sysroots/x86_64-pokysdk-linux/usr/bin/runqemu&quot;, line 619, in check_and_set
      check_tun()
    File &quot;/opt/poky/sdk/sysroots/x86_64-pokysdk-linux/usr/bin/runqemu&quot;, line 103, in check_tun
      raise Exception(&quot;TUN control device %s is unavailable; you may need to enable TUN (e.g. sudo modprobe tun)&quot; % dev_tun)
Exception: TUN control device /dev/net/tun is unavailable; you may need to enable TUN (e.g. sudo modprobe tun)

I&apos;ve also tried to workaround this by bind-mounting host /dev/net/tun (docker run ... -v /dev/net/tun:/dev/net/tun ...) but I prompted to enter pokyuser password which I don&apos;t know. But in any case this might not be a good idea as it will only work on Linux hosts.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78815</commentid>
    <comment_count>1</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-12-22 17:07:05 +0000</bug_when>
    <thetext>Enabling TAP devices in the container is difficult on Linux (requires root and doesn&apos;t play nicely with shared systems) and won&apos;t work at all on Windows or macOS. 

Instead we&apos;ll need to add slirp support as in https://bugzilla.yoctoproject.org/show_bug.cgi?id=10713

*** This bug has been marked as a duplicate of bug 10713 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>