Ubuntu 18.04 LTS makes old iPad a sub monitor without WiFi

Last time As a result, iPad 3 can be used as a sub monitor of Ubuntu by using VNC, but this method can be used for the same wireless network. It cannot be realized if it is not connected.

It doesn't matter if you're inside the house, but if you take it outside, for example, if you have a free spot (~~ still resists ~~ it doesn't seem to allow connections between clients), WiFi If there is no place at all, the iPad will be just a baggage.

So you can use your iPad as a sub monitor without WiFi

--Do not change the method of making it a sub monitor (using VNC) --The network is not ** connected via wireless network, but connected from iPad to ubuntu hotspot using Ubuntu as a hotspot ** --Also, make it possible to connect to the Internet from Ubuntu --Hotspot connection = Almost direct connection, I hope that the operation of the sub monitor will improve a little.

Considering this, the results achieved by trial and error are shown below as an example.

Hotspot

To make the wireless LAN adapter a hotspot on Ubuntu 18.04, do the following:

  1. [Settings] → [Wi-Fi] → (Hamburger on the upper right) → [Turn on Wi-Fi access point]
  2. Press "On" in the dialog that appears (plus a disturbing message) to see the information to connect to this hotspot (network name, encryption method, password).
  3. Select the above network name from [Settings] → [Wi-Fi] on the iPad to connect.

However, no matter how many times I try, I get a password error and cannot connect. I wanted to make sure that I could connect to the Ubuntu hotspot for the time being, so I was looking for a way to invalidate the password, though it was a bad idea.

  1. Execute [alt + f2] → [nm-connection-editor]
  2. Double-click (or gear button) on the "Hotspot" line
  3. Open the [Wi-Fi Security] tab, set Security to [None], and click "Save".
  4. Turn off the Wi-Fi access point in [Settings] → [Wi-Fi]
  5. After switching to the list of wireless network access points, again (hamburger on the upper right) → [Turn on Wi-Fi access points] → "On" in the dialog
  6. Only the hotspot network name should be displayed
  7. Select the above network name from [Settings] → [Wi-Fi] on the iPad to connect.

Now that I've been able to connect, I'm sure there's something wrong with encryption. It's an old one, so I imagined that the adapter doesn't support the new method.

In addition, it is a habit to check the IP address

$ ifconfig

I was surprised to hear "Command ifconfig not found ".

So immediately

$ sudo apt install net-tools

I kept it.

vino

Can't you connect at a hotspot?

Since the network was connected, I opened [Settings] → [Sharing] → [Screen Sharing] on the PC side to reconfirm the settings.

qiita_20201109_1.png

The network was x. Moreover, there is nothing else that can be done other than pressing x = deleting, so it seems that it can not be done from this screen anymore.

So, as usual, I rowed out into the sea of the net and sprinkled around.

Setting value 1: gsettings

I changed require-encryption with the "gsettings command" to disable the encryption process, but I was able to confirm the settings related to vino including this with the following command.

$ gsettings list-recursively org.gnome.Vino
org.gnome.Vino notify-on-connect true
org.gnome.Vino alternative-port uint16 5900
org.gnome.Vino disable-background false
org.gnome.Vino use-alternative-port false
org.gnome.Vino icon-visibility 'client'
org.gnome.Vino use-upnp false
org.gnome.Vino view-only false
org.gnome.Vino prompt-enabled false
org.gnome.Vino disable-xdamage false
org.gnome.Vino authentication-methods ['vnc']
org.gnome.Vino network-interface ''
org.gnome.Vino require-encryption false
org.gnome.Vino mailto ''
org.gnome.Vino lock-screen-on-disconnect false
org.gnome.Vino vnc-password 'xxxxxxx'
$

At first glance, the "network-interface" that looks like it sets "lo" when connecting to itself, and it is usually empty. Other than this, it doesn't look like that, so I gave up on this direction.

(reference) https://help.ubuntu.com/community/VNC/Servers

Setting value # 2: dconf

In dconf

org.gnome.setting-daemon.plugins.shareing.service.enabled-connections

There is a key called "List the UUIDs of network I / Fs used by vino" in this value.

First, the "UUID" of the network I / F was confirmed with the following command.

$ nmcli con show
NAME            UUID                                  TYPE      DEVICE  
(Wireless connection)     XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX  wifi      -- 
Hotspot         YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY  wifi      wlxxxx0      
Wired connection 1 ZZZZZZZZ-ZZZZ-ZZZZ-ZZZZ-ZZZZZZZZZZZZ  ethernet  --      

Next, check the current setting value.

$ dconf read /org/gnome/settings-daemon/plugins/sharing/vino-server/enabled-connections
['XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX']

Since only the UUID of the wireless connection was registered, I registered the registered UUID and the UUID of the hotspot by connecting them with a comma (since it seems that some dconf cannot be added or deleted).

$ dconf write /org/gnome/settings-daemon/plugins/sharing/vino-server/enabled-connections "['XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX','YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY']"
$ dconf read /org/gnome/settings-daemon/plugins/sharing/vino-server/enabled-connections
['XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX','YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY']

I confirmed that the values are the same in the dconf editor.

If you open [Settings] → [Sharing] → [Screen Sharing] again ...

qiita_20201109_2.png

Wow, it's really bad.

Turn on the hotspot while embracing a single hope ...!

・ ・ ・ Thank you for your hard work (I couldn't connect)

movement of vino

I tried to follow the movement of vino again.

First, I went back from the hotspot to the wireless network and checked the process and the port number listening.

$ ps -alx | grep vino
0  1000  2333  1337  20   0 587904 30408 poll_s Ssl  ?          0:00 /usr/lib/vino/vino-server
0  1000  3585  1872  20   0  15456  1120 pipe_w S+   pts/0      0:00 grep --color=auto vino
$ netstat -pl | grep 2333
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      2333/vino-server    
tcp6       0      0 [::]:5900               [::]:*                  LISTEN      2333/vino-server    

You can see that a process called vino-server is running and listening on port 5900. If you look at the parent PID of vino-server,

$ ps -alx | grep 1337
4  1000  1337     1  20   0  77228  8348 ep_pol Ss   ?          0:00 /lib/systemd/systemd --user
:

So I also found out that I was kicked by systemd.

If you switch to a hotspot here and check again

$ ps -alx | grep vino
$ netstat -pl | grep 59
$

There was no vino-server, and there were no processes waiting on port 5900. When I returned to the wireless connection again, vino-server restarted (the process ID was different), and it returned to the standby state on boat 5900.

So, if you turn on [Screen Sharing], you can see that the vino-server (VNC server) is raised or lowered by looking at the status of the network I / F. Even if the UUID of the hotspot is registered in dconf, vino will be terminated, so it seems that not only the UUID but also whether it is a hotspot is checked.

In addition, since vino-server is started from systemd, I wondered if it was controlled by systemctl, but I couldn't find the word vino. When it comes to that, it seems that gnome is doing something, and I just chase after it and get hooked on the depths.

I'm sorry, I think I can do it soon.

Manual launch of vino

Looking at the standby status of vino once again

$ netstat -pl | grep 2333
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      2333/vino-server    
tcp6       0      0 [::]:5900               [::]:*                  LISTEN      2333/vino-server    

So, although the port number is specified, the IP address does not seem to be fixed. In that case, it is speculated that if vino is still running, it may be connected even from wireless disconnection & hotspot without automatically raising and lowering by setting [Screen sharing].

Therefore,

  1. Click [Settings] → [Sharing] → [Screen Sharing Active]
  2. Turn off the switch on the upper left of the screen sharing window and press x.
  3. Confirm that the screen sharing is enabled.
  4. Execute "ps -alx | grep vino" on [Terminal] to confirm that vino-server does not exist.

After that, I ran vino-server manually.

$ /usr/lib/vino/vino-server
09/11/2020 17:14:24 Autoprobing TCP port in(all) network interface
09/11/2020 17:14:24 Listening IPv6://[::]:5900
09/11/2020 17:14:24 Listening IPv4://0.0.0.0:5900
09/11/2020 17:14:24 Autoprobing selected port 5900
09/11/2020 17:14:24 Advertising security type: 'TLS' (18)
09/11/2020 17:14:24 Re-binding socket to listen for VNC connections on TCP port 5900 in (all) interface
:
:
$ ^C
$ ps -alx | grep vino
0  1000  4051  1872  20   0 587896 30284 signal Tl   pts/0      0:00 /usr/lib/vino/vino-server
$ netstat -pl | grep vino
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      4051/vino-server    
tcp6       0      0 [::]:5900               [::]:*                  LISTEN      4051/vino-server    
$

Here again, switch the wireless to the hotspot and connect again from the iPad to the hotspot. If you can connect, specify the IP address of the hotspot in VNC Viewer and connect ...

It was reflected in VNC of iPad! !! Apparently this is fine.

vino autorun settings

It's a pattern every time, but it's not beautiful to type commands from the terminal every time.

--Booting from systemctl --Automatic startup at login

I thought about two things.

The former systemctl was set by referring to the following site.

(reference) https://askubuntu.com/questions/636270/vino-vnc-server-unable-to-start-on-startup

However, when I checked the status after enabling it with systemctl, vino failed with an error such as the display not being found. I searched for vino options and systemctl a little, but it seems that it will not be solved soon, so I gave up once.

On the other hand, the latter is automatically started at login, but when I was doing this and that, I found the following vino-server desktop file.

$ cd /usr/share/applications/
$ sudo nano vino-server.desktop
---
[Desktop Entry]
Name=Desktop Sharing
Comment=GNOME Desktop Sharing Server
Keywords=vnc;share;remote;
Exec=/usr/lib/vino/vino-server --sm-disable
Icon=preferences-desktop-remote-desktop
NoDisplay=true
Terminal=false
Type=Application
X-GNOME-Autostart-Phase=Applications
X-GNOME-AutoRestart=true
X-GNOME-UsesNotifications=true
X-Ubuntu-Gettext-Domain=vino
---

When I changed NoDisplay from true to false as a trial, the icon "Desktop ..." appeared in the launcher. When I double-clicked this icon without vino-server, vino-server started up and I was able to connect with VNC, so I will use the value of this EXEC.

Then, open [View applications] → [Settings for applications to start automatically] and click [Add].

--Name: (appropriately) vino-server --Command: / usr / lib / vino / vino-server --sm-disable --Description: (Appropriately) Desktop Sharing

qiita_20201109_4.png

After saving, log off and log in once.

After logging in, I confirmed that vino-server was automatically started, and then confirmed that VNC was connected both via the wireless network and via the hotspot.

Summary

There were twists and turns, but to summarize.

Sub-monitoring the tablet via wireless network (previous)

  1. Connect your PC and tablet to a wireless network
  2. Set a password etc. in [Settings] → [Sharing] → [Screen Sharing] on the PC, and turn on the switch on the upper left to activate it.
  3. Connect by specifying the "wireless network IP address" of the PC from the VNC Viewer on the tablet, and confirm that the screen can be shared on the VNC.
  4. Disconnect once and set the virtual display of the PC
  5. Enable virtual desktops on your PC to expand your screen
  6. By connecting VNC with this screen area expanded, the tablet can be turned into a sub monitor!

Sub-monitoring tablet even with hotspot connection (this time)

  1. Select [Settings]-> [Sharing]-> [Screen Sharing] on the PC and set the upper left switch to "Off" to change from Active to "Enable".
  2. Register vino-server for autostart
  3. Make your PC's wireless adapter a hotspot
  4. Connect your tablet to your PC hotspot
  5. Enable virtual desktops on your PC to expand your screen
  6. Specify the "hotspot IP address" of the PC in the VNC Viewer of the tablet and connect, and confirm that the screen can be shared on the VNC. Now you can sub-monitor your tablet even in an environment without WiFi!

Miscellaneous feelings

――I don't think this is the right path, but I'm glad that I managed to reach the point where I achieved my first goal.

But, however

When the hotspot is turned on, the following dialog is displayed.

qiita_20201109_3.png

So, as you can see in this message, turning on the hotspot will disconnect the wireless network, so I mentioned it as a purpose.

--Also, make it possible to connect to the Internet from Ubuntu

Will not be fulfilled.

Well, what should I do ...

Recommended Posts

Ubuntu 18.04 LTS makes old iPad a sub monitor without WiFi
Old notebook + Ubuntu 18.04 LTS makes old iPad a sub monitor
Use virtual AP on Ubuntu 18.04 LTS to sub-monitor old iPad