diff --git a/krfb/invitationsrfbserver.cpp b/krfb/invitationsrfbserver.cpp
index 33dac04..e3c1775 100644
--- a/krfb/invitationsrfbserver.cpp
+++ b/krfb/invitationsrfbserver.cpp
@@ -81,6 +81,11 @@ const QString& InvitationsRfbServer::unattendedPassword() const
     return m_unattendedPassword;
 }
 
+bool InvitationsRfbServer::enableSharing() const
+{
+    return m_enableSharing;
+}
+
 void InvitationsRfbServer::setUnattendedPassword(const QString& password)
 {
     m_unattendedPassword = password;
@@ -108,6 +113,11 @@ void InvitationsRfbServer::stop()
     RfbServer::stop();
 }
 
+void InvitationsRfbServer::toggleSharing(bool allow)
+{
+    m_enableSharing = allow;
+}
+
 void InvitationsRfbServer::toggleUnattendedAccess(bool allow)
 {
     m_allowUnattendedAccess = allow;
@@ -117,6 +127,9 @@ InvitationsRfbServer::InvitationsRfbServer()
 {
     m_desktopPassword = readableRandomString(4)+"-"+readableRandomString(3);
     m_unattendedPassword = readableRandomString(4)+"-"+readableRandomString(3);
+    KConfigGroup krfbConfig(KSharedConfig::openConfig(),"MainWindow");
+    m_enableSharing = krfbConfig.readEntry(
+            "enableSharing", QVariant(false)).toBool();
     KConfigGroup krfbConfig(KSharedConfig::openConfig(),"Security");
     m_allowUnattendedAccess = krfbConfig.readEntry(
             "allowUnattendedAccess", QVariant(false)).toBool();
@@ -125,6 +138,8 @@ InvitationsRfbServer::InvitationsRfbServer()
 InvitationsRfbServer::~InvitationsRfbServer()
 {
     stop();
+    KConfigGroup krfbConfig(KSharedConfig::openConfig(),"MainWindow");
+    krfbConfig.writeEntry("enableSharing",m_enableSharing);
     KConfigGroup krfbConfig(KSharedConfig::openConfig(),"Security");
     krfbConfig.writeEntry("allowUnattendedAccess",m_allowUnattendedAccess);
     if(!KrfbConfig::noWallet()) {
@@ -145,6 +160,9 @@ InvitationsRfbServer::~InvitationsRfbServer()
                 KStringHandler::obscure(m_unattendedPassword));
         krfbConfig.writeEntry("allowUnattendedAccess",
                 m_allowUnattendedAccess);
+        KConfigGroup krfbConfig(KSharedConfig::openConfig(),"MainWindow");
+        krfbConfig.writeEntry("enableSharing",
+                m_enableSharing);
     }
 }
 
diff --git a/krfb/invitationsrfbserver.h b/krfb/invitationsrfbserver.h
index 34f7165..70233e0 100644
--- a/krfb/invitationsrfbserver.h
+++ b/krfb/invitationsrfbserver.h
@@ -42,6 +42,7 @@ public:
     const QString& unattendedPassword() const;
     void setUnattendedPassword(const QString&);
     bool allowUnattendedAccess() const;
+    bool enableSharing() const;
 
 Q_SIGNALS:
     void passwordChanged(const QString&);
@@ -50,6 +51,7 @@ public Q_SLOTS:
     bool start() override;
     void stop() override;
     void toggleUnattendedAccess(bool allow);
+    void toggleSharing(bool allow);
 
 protected:
     InvitationsRfbServer();
@@ -62,6 +64,7 @@ private Q_SLOTS:
 private:
     KDNSSD::PublicService *m_publicService;
     bool m_allowUnattendedAccess;
+    bool m_enableSharing;
     QString m_desktopPassword;
     QString m_unattendedPassword;
     KWallet::Wallet *m_wallet;
diff --git a/krfb/krfb.kcfg b/krfb/krfb.kcfg
index e0683d8..d6715d6 100644
--- a/krfb/krfb.kcfg
+++ b/krfb/krfb.kcfg
@@ -8,6 +8,10 @@
     <label>Start minimized</label>
     <default>false</default>
     </entry>
+    <entry name="enableSharing" type="Bool">
+      <label>Enable sharing.</label>
+      <default>false</default>
+    </entry>
   </group>
   <group name="TCP">
     <entry name="useDefaultPort" type="Bool">
diff --git a/krfb/mainwindow.cpp b/krfb/mainwindow.cpp
index 197719b..803cd6d 100644
--- a/krfb/mainwindow.cpp
+++ b/krfb/mainwindow.cpp
@@ -57,6 +57,9 @@ MainWindow::MainWindow(QWidget *parent)
     QWidget *mainWidget = new QWidget;
     m_ui.setupUi(mainWidget);
     m_ui.krfbIconLabel->setPixmap(QIcon::fromTheme("krfb").pixmap(128));
+    m_ui.enableSharingCheckBox->setChecked(
+            InvitationsRfbServer::instance->enableSharing());
+    toggleDesktopSharing(InvitationsRfbServer::instance->enableSharing());
     m_ui.enableUnattendedCheckBox->setChecked(
             InvitationsRfbServer::instance->allowUnattendedAccess());