1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

User's Manual for Across for Linux – Version 2.21

Discussion in 'General Discussion' started by Seungjin Lee, Mar 14, 2020.

Thread Status:
Not open for further replies.
  1. Seungjin Lee

    Seungjin Lee Member

    Prerequsites
    1. All program binaries are built in Ubuntu 16.04 (using the latest version of gcc, Qt, openssl, libxml2). You would need a Linux distro released after that version.
    2. acrossd (across core program) works as a systemd service. Therefore systemd must be running on Linux.
    3. Across for Linux uses davfs2 (https://savannah.nongnu.org/projects/davfs2) to mount file share of paired devices. You can browse/open/copy/save files to/from paired devices using it, and its mount point is /mnt/acrossfs/. Though it can be installed by installing prebuilt davfs2 package (i.e., sudo apt-get install davfs2 for Debian/Ubuntu, sudo yum install -y davfs2 for RedHat/CentOS, sudo pacman -Sy --noconfirm davfs2 for Arch), we recommend to build it using the latest version of source code. For its build, you need to build neon (http://www.webdav.org/neon/) first (configure --prefix=/usr/local/libneon --with-ssl) and then build davfs2 (configure --with-neon=/usr/local/libneon). See the below posting.


    Known Issues
    1. If you use a Linux PC as an Across Client but mouse input from Across Server through Bluetooth would not work, you would need to patch and build kernel by referring this article (https://community.acrosscenter.com/index.php?threads/for-a-linux-client.122/). It is not sure from what kernel version patched it, this issue seems to be patched in kernel version 5.x. Therefore if you are using a recent Linux distro, you would not need this.
    2. Across works in a X Window session only, but does not in a Wayland session. (We will support Wayland someday.)
    3. When a Linux works as an Across Server and you want to pair a Windows PC as an Across Client, the Windows PC must have across installed and it must be in Across Server mode during Bluetooth pairing. In the Windows PC, do not open any window of across but just leave it in Across Server mode during Bluetooth pairing. Once Bluetooth pairing done, change its mode to Across Client in the Windows PC. (We need cooperation with Bluez – Linux Bluetooth stack – to resolve this issue.)
    4. For Linux+macOS combination, if you would experience repetitive Bluetooth reconnections, try to remove pulseaudio-module-bluetooth package (i.e., sudo apt-get remove pulseaudio-module-bluetooth for Debian/Ubuntu).

    5. If you are using "Files" (Nautilus) app for file browser app, you would have troubles in copy files between computers. Please use other substitutes (Nemo, ...) instead of it.
    6. When a Linux works as an Across Client and you want to remove Bluetooth pairing of a server, you need to change operation mode of the Linux PC to Across Server mode. Otherwise, Bluez would never remove Bluetooth pairing. It could be a bug of Bluez.


    Installation / Update
    1. Download the install package and then extract it in Terminal by running the following command:
    tar xvfz across-linux-PLATFORM-X_YY.tar.gz (where, across-linux-PLATFORM-X_YY.tar.gz is the downloaded file name)​
    2. Go into the extracted directory (cd across-install-package) and then run the install shell script with root privilege (sudo ./install.sh). Across is installed in /usr/local/bin/across.
    3. Run the installed /usr/local/bin/across/AcrossCenter (/usr/local/bin/across/AcrossCenter& disown) and then you will see Across is running in the system tray.

    Configuration for Bluetooth tools
    Once installation done, you need to configure command-line for Bluetooth tools in your Linux machine and configuration dialog (launched by the “Bluetooth tools...” from the system tray menu in Across Client mode, and the main menu > Configuration > “Bluetooth tools...” in Across Server mode) looks like the below picture:
    [​IMG]
    1. The first command-line is executed when you click the “Add an Across Server” from the system tray menu in Across Client mode. You need to set the command-line used to add a Bluetooth device.
    2. The second command-line is executed when you click the “Display Bluetooth Devices” from the system tray menu in Across Client mode, and the “Bluetooth Devices” toolbar item in Across Server mode. You need to set the command-line used to show paired Bluetooth devices.
    3. Both command-lines can be found by running ps -elf | grep blue after running each Bluetooth tool available in your Linux distro. The two command-lines could be identical in some Linux and different in others.

    4. This Wiki thread (https://community.acrosscenter.com/index.php?threads/wiki-bluetooth-tools-command-lines-for-linux.322/) has those values for Linux distros and add the found command-lines for your Linux in the thread for other users, if not listed.

    Removal
    Run the remove shell script (/usr/local/bin/across/remove.sh) in Terminal with root privilege:
    sudo /usr/local/bin/across/remove.sh
    Despite of it, all configuration files will still remain. If you want to completely remove across, use the following command instead:
    sudo /usr/local/bin/across/remove.sh -f
     
    Last edited: Feb 16, 2021
  2. Seungjin Lee

    Seungjin Lee Member

    across for Linux — Addendum for Ver 2.21

    1. Davfs2 patch required
    From the version 2.20 of across, across uses a link-local address for IPv6 connections as mentioned in our release note. However, there is a bug in Linux system libraries to get the correct IPv6 address for a link-local address. To workaround the problem, we need to patch the neon library on which davfs2 depends. The patch is very easy. Please follow the below steps:
    A. If you don't have davfs2 installed, install it by installing a prebuilt davfs2 package (i.e., sudo apt-get install davfs2 for Debian/Ubuntu, sudo yum install davfs2 for RedHat/CentOS, sudo pacman -Sy davfs2 for Arch). During installation, some settings including dav user/group register will be made.
    B. Remove davfs2 (i.e., sudo apt-get remove davfs2 for Debian/Ubuntu, sudo yum remove davfs2 for RedHat/CentOS, sudo pacman -R davfs2 for Arch).
    C. Get the neon source code from github (use the v0.31.x of neon library instead of the master version) and patch "src/ne_socket.c" as shown below: (You can get the zip file including the original file, patched file, and diff text file)
    Code:
    965a966,1040
    > #include <ctype.h>
    > #include <net/if.h>
    > #include <linux/if.h>
    >
    > #define HOSTS_FILE_PATH  "/etc/hosts"
    > #define STACK_BUF_SIZE   2048
    >
    > static int get_ifindex_from_hosts(const char *hostname, unsigned long *ifindex)
    > {
    >      struct stat sb;
    >      if (!hostname || !ifindex || stat(HOSTS_FILE_PATH, &sb) != 0 || !S_ISREG(sb.st_mode) || sb.st_size < 10)
    >          return -1;
    >
    >      char array[STACK_BUF_SIZE];
    >      size_t len = sb.st_size;
    >
    >      const int fd = open(HOSTS_FILE_PATH, O_RDONLY);
    >      if (fd < 0)
    >          return -1;
    >
    >      char *buf;
    >      off_t offset = 0;
    >      if (len > STACK_BUF_SIZE-1)
    >      {
    >          buf = (char *)malloc(len+1);
    >          if (!buf) {
    >              buf = array;
    >              offset = len - (STACK_BUF_SIZE-1);
    >              if (lseek(fd, offset, SEEK_SET) == -1)
    >                  offset = 0;
    >              len = STACK_BUF_SIZE-1;
    >          }
    >      }
    >      else
    >          buf = array;
    >
    >      posix_fadvise(fd, offset, len, POSIX_FADV_SEQUENTIAL);
    >
    >      int r = -1;
    >      if (read(fd, buf, len) == (ssize_t)len) {
    >          buf[len] = '\0';
    >          char *line = buf;
    >          char *ptr;
    >          while (r && (ptr=strstr(line, hostname)) != NULL) {
    >              char *ptr2 = ptr;
    >              if (ptr > line+10 && (*(ptr-1) == '\t' || *(ptr-1) == ' ')) {
    >                  *(ptr-1) = '\0';
    >                  ptr -= 2;
    >                  for (int i = 0; ptr > line && i <= IFNAMSIZ; ptr--) {
    >                      if (*ptr == '%') {
    >                          if (strlen(ptr+1) > 0) {
    >                              *ifindex = if_nametoindex(ptr+1);
    >                              r = 0;
    >                          }
    >                          break;
    >                      }
    >                      else if (!i && (*ptr == '\t' || *ptr == ' ')) {
    >                          *ptr = '\0';
    >                          continue;
    >                      }
    >                      else if (isspace(*ptr))
    >                          break;
    >                      i++;
    >                  }
    >              }
    >              line = ptr2 + strlen(hostname);
    >          }
    >      }
    >
    >      if (buf != array)
    >          free(buf);
    >      close(fd);
    >      return r;
    > }
    >
    1010a1086,1093
    >          if (addr->result->ai_addr->sa_family == AF_INET6) {
    >              struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)addr->result->ai_addr;
    >              if (IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr) && !addr6->sin6_scope_id) {
    >                  unsigned long ifindex = 0;
    >                  if (get_ifindex_from_hosts(hostname, &ifindex) == 0)
    >                     addr6->sin6_scope_id = ifindex;
    >              }
    >          }
    
    D. Build neon and install: autogen >> config >> make >> make install
    ./autogen.sh
    ./configure --prefix=/usr/local/libneon --with-ssl
    make
    sudo make install

    E. Get the davfs2 source code from its site, and build and install with config >> make >> make install
    ./configure --with-neon=/usr/local/libneon
    make
    sudo make install


    2. Remarks
    A. If you are using selinux, selinux could prevent across from registering and running the acrossd.service. If you have got error messages during installing or launching AcrossCenter, please check whether selinux enables service register/start/stop allowed for a 3rd party app.
    B. For iOS/iPadOS/macOS screen mirroring, avahi-daemon must be running. You can check its status by systemctl status avahi-daemon.
    C. For the fresh 2021-01-11 RasberryPi OS, you need to install 3 packages: libssl-dev, libtool, libbluetooth-dev. For smooth screen mirroring, you need to set "gpu_mem=128" in /boot/config.txt and run raspi-config and choose "Advanced Options" > "GL Driver" and then choose "GL (Fake KMS) OpenGL desktop driver with fake KMS".
    D. For the fresh Manjaro-ARM-xfce-rpi4-20.12.1,
    a. Required packages: libtool, m4, automake, autoconf, gcc, pkgconfig, openssl, make, sndio, avahi
    b. After davfs2 patching, sudo groupadd davfs2 (create davfs2 group) and sudo useradd -g davfs2 davfs2 (create davfs2 user to the davfs2 group)
    c. Copy /usr/lib/libsndio.so.7.1 as /usr/lib/libsndio.so.7.0 on which across binaries depend. i.e., sudo cp /usr/lib/libsndio.so.7.1 /usr/lib/libsndio.so.7.0
    d. Enable and start avahi-daemon, i.e., sudo systemctl enable avahi-daemon, and then sudo systemctl start avahi-daemon
    e. For smooth screen mirroring, set "gpu_mem=128" in /boot/config.txt. (Reboot required)
     
    Last edited: Feb 16, 2021
Thread Status:
Not open for further replies.

Share This Page