How to Install SiriProxy on Ubuntu 12.10

Just got done installing SiriProxy on Linux Ubuntu 12.10.  I had to make a few minor tweaks along the way, so perhaps this updated guide will be helpful to someone.

  1. Do this first: Open a terminal server (command line from here on out). Update apt-get:
    user@ubtunu:~$ sudo apt-get update
    user@ubuntu:~$ sudo apt-get install libxslt1.1 libxslt-dev build-essential xvfb git-core curl libyaml-dev libssl-dev
  2. Turn off dnsmasq: The latest version of SiriProxy comes with its own DNS server, so there is no need to install dnsmasq like some older instructional tutorials might recommend. In fact, it will really muck things up if it is installed. Ubuntu has dnsmasq on in a default installation (used by the “simple” network config tool: NetworkManager), so we will need to stop it and shut it off for good. First see if its running, and stop (kill) it if it is:
    user@ubtunu:~$ pkill dnsmasq

    Now we need to stop it from starting again, by turning it off in this file: /etc/NetworkManager/NetworkManager.conf – comment out the dns line like so:

    #dns=dnsmasq

    Now just restart networking:

    user@ubuntu:~$ sudo restart network-manager
  3. Install RVM:
    user@ubuntu:~$ curl -L https://get.rvm.io | bash -s stable --ruby

    Update your environment variables:

    user@ubuntu:~$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
    user@ubuntu:~$ echo 'export PATH=$HOME/.rvm/bin:$PATH' >> ~/.bashrc
    user@ubuntu:~$ . ~/.bashrc
  4. Install Ruby:
    user@ubuntu:~$ rvm autolibs enable
    user@ubuntu:~$ rvm install 2.0.0
    user@ubuntu:~$ rvm use 2.0.0 --default
  5. Install SiriProxy: This is where I had to take a different path from the installation instructions provided in the github read-me. The version that was installed using gem install had a bug preventing the DNS server from working, so I needed to get the latest source and install from that. Be sure to replace the version number with the version downloaded in some of the steps below:
    user@ubuntu:~$ mkdir SiriProxyLocal
    user@ubuntu:~$ cd SiriProxyLocal
    user@ubuntu:~/SiriProxyLocal$ git clone https://github.com/plamoni/SiriProxy.git
    ...bunch of stuff...
     
    user@ubtunu:~/SiriProxyLocal$ gem build siriproxy.gemspec
    ...bunch of stuff...
     
    user@ubtunu:~/SiriProxyLocal$ gem install siriproxy-0.5.3.gem
    ...bunch of stuff...

    You should see a message telling you that your gem has been installed. Nice!

  6. Configure and a few last things:
    user@ubuntu:~/SiriProxyLocal$ cd ~
    user@ubuntu:~$ mkdir .siriproxy
    user@ubuntu:~$ cp SiriProxyLocal/config.example.yml .siriproxy/config.yml
    user@ubtunu:~$ vi .siriproxy/config.yml

    Edit this config file, replacing the “listen” IP address with your own. The upstream dns servers are important too.. if they aren’t set like below, set them. These are Google’s DNS servers that everything will pass through to (except the Siri address):

    listen: 192.168.0.17
    port: 443
    log_level: 1
     
    #Create an array of DNS servers for use by internal DNS server and resolving guzzoni.apple.com
    upstream_dns: [8.8.8.8, 8.8.4.4]
     
    #Set your computer's IP for use by the internal DNS server
    # server_ip: 192.168.1.100
     
    #Set effective user when running as root. Supply a non-privileged user (such as 'nobody')
    # user: nobody
  7. Generate the certs
    We need to generate a certificate to install to your phone (don’t worry, this is easy):

    user@ubuntu:~$ siriproxy gencerts

    This puts a file here: ~/.siriproxy/ca.pem
    We need to install this to the phone. To do this, I installed WinSCP, copied onto my windows machine, and emailed it to my phone as an attachment. There is probably a way to do this from command line, but I didn’t want to mess with setting up mail on this Ubuntu machine. Once you have it in your email, open the file from your phone and “Accept” the security warning as a trusted cert.  Having this extra cert won’t harm anything on your phone.

  8. Start the server!
    Replace the XX.XX.XX.XX with the ip address of the machine (hint: use ifconfig to see the IP)

    user@ubuntu:~$ rvmsudo siriproxy server -d XX.XX.XX.XX

    Which should produce something like this:

    WARN: Unresolved specs during Gem::Specification.reset:
          rake (>= 0)
    WARN: Clearing out unresolved specs.
    Please report a bug if this causes problems.
    [Info - Configuration] Loading plugins -- If any fail to load, run `siriproxy bundle` (not `bundle install`) to resolve.
    [Notice - Server] ======================= WARNING: Running as root =============================
    [Info - Server] DNS Server started, tainting 'guzzoni.apple.com' with 192.168.0.17[Notice - Server] You should use -l or the config.yml to specify and non-root user to run under
    [Notice - Server] Running the server as root is dangerous.
    [Notice - Server] ==============================================================================
    [Info - Server] Starting SiriProxy on 192.168.0.17:443...
    [Info - Server] DNS server is not running yet, waiting 1 second...
     
    [Info - Server] SiriProxy up and running.
  9. Configure and test your phone:
    This one is easy, just set your “DNS” entry on your wifi connection to your Ubuntu machine’s IP.  Now you should be able to watch the screen, and test SiriProxy by saying “Test Siri Proxy” to Siri!

If you want to start messing around with plugins, the guide here is a good start.  If anyone has any hiccups on a fresh Ubuntu install, let me know and I’ll make corrections/updates. Have fun!

7 thoughts on “How to Install SiriProxy on Ubuntu 12.10

  1. Nik

    hi,
    firstly thanks for the simple write up, on getting started. I have installed ubuntu 12.10 desktop 32bit addition and followed your steps, however on step 4 I get the following errors

    :~$ rvm install 2.0.0
    Searching for binary rubies, this might take some time.
    No binary rubies available for: ubuntu/12.10/i386/ruby-2.0.0-p0.
    Continuing with compilation. Please read ‘rvm mount’ to get more information on binary rubies.
    Installing requirements for ubuntu, might require sudo password.
    Skipping `apt-get update` make sure your system is up to date.
    RVM autolibs is now configured with mode ‘2’ => ‘check and stop if missing’,
    please run `rvm autolibs enable` to let RVM do it’s job or run and read `rvm autolibs [help]`
    or visit https://rvm.io/rvm/autolibs for more information.
    Missing required packages: libreadline6-dev, libsqlite3-dev, sqlite3, autoconf, libgdbm-dev, libncurses5-dev, automake, libtool, bison, libffi-dev.
    RVM autolibs is now configured with mode ‘2’ => ‘check and stop if missing’,
    please run `rvm autolibs enable` to let RVM do it’s job or run and read `rvm autolibs [help]`
    or visit https://rvm.io/rvm/autolibs for more information.

    Reply
    1. David Post author

      Hi Hik, did it work after running the “rvm autolibs enable” command? I do, in fact, remember having to run this when I went through… I’ll update the guide. Good catch!

      Reply
      1. Nik

        David,

        Yep I did run the “rvm autolibs enable” and was then able to progress with step 5 until complete.
        I now have this up and running. Many Thanks for the simple to follow guide.

        Regards
        Nik

        Reply
  2. Marc

    Hi and thanks for the tutorial

    When I’m installing the siriproxy gem I get the following error:
    ERROR: Error installing siriproxy-0.5.4.gem:
    rubydns requires Ruby version >= 1.9.3.

    I followed all steps and I’m sure I installed ruby version 2.0.0

    Reply
  3. den

    How to fix this error:
    === Performing Rake Install ===
    siriproxy 0.5.4 built to pkg/siriproxy-0.5.4.gem.
    siriproxy (0.5.4) installed.
    === Bundling ===
    /root/.gem/ruby/2.4.0/gems/siriproxy-0.5.4/lib/siriproxy/command_line.rb:84:in “’: No such file or directory – bundle (Errno::ENOENT)
    from /root/.gem/ruby/2.4.0/gems/siriproxy-0.5.4/lib/siriproxy/command_line.rb:84:in `run_bundle’
    from /root/.gem/ruby/2.4.0/gems/siriproxy-0.5.4/lib/siriproxy/command_line.rb:41:in `initialize’
    from /root/.gem/ruby/2.4.0/gems/siriproxy-0.5.4/bin/siriproxy:6:in `new’
    from /root/.gem/ruby/2.4.0/gems/siriproxy-0.5.4/bin/siriproxy:6:in `’
    from /usr/bin/siriproxy:22:in `load’
    from /usr/bin/siriproxy:22:in `’
    Thank you!

    Reply
  4. Jayden

    Hi
    I have gotten stuck when trying to restart network manager
    I tried typing it in without sudo and installed the software it suggested but now it says
    restart: unable to connect to upstart: failed to connect to socket /com/Ubuntu/upstart: connection refused
    I am running Ubuntu mate 16.04 for raspberry pi
    any ideas?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *